annotate src/.gdbinit @ 939:c4dcdc9aed70

Clear the eighth bit of the character from the key sequence, NOT the index of the character IN the key sequence. How many tries will it take to get it right?
author Jim Blandy <jimb@redhat.com>
date Wed, 05 Aug 1992 05:18:27 +0000
parents a8d94735277e
children fc4f68fff750
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1 # Set up something to print out s-expressions.
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2 define pr
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3 set Fprin1 ($, Qexternal_debugging_output)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4 echo \n
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6 document pr
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7 Print the emacs s-expression which is $.
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8 Works only when an inferior emacs is executing.
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 define xtype
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12 print (enum Lisp_Type) (($ >> 24) & 0x7f)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 p $$
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
15 document xtype
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
16 Print the type of $, assuming it is an Elisp value.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
17 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19 define xint
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20 print (($ & 0x00ffffff) << 8) >> 8
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
22 document xint
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
23 Print $, assuming it is an Elisp integer. This gets the sign right.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
24 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
26 define xptr
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27 print (void *) ($ & 0x00ffffff)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
29 document xptr
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
30 Print the pointer portion of $, assuming it is an Elisp value.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
31 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
32
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33 define xwindow
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34 print (struct window *) ($ & 0x00ffffff)
727
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 648
diff changeset
35 print ($->left)@4
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 648
diff changeset
36 print $$
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
38 document xwindow
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
39 Print $ as a window pointer, assuming it is an Elisp window value.
727
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 648
diff changeset
40 Print the window's position as { left, top, height, width }.
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
41 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43 define xmarker
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 print (struct Lisp_Marker *) ($ & 0x00ffffff)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
46 document xmarker
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
47 Print $ as a marker pointer, assuming it is an Elisp marker value.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
48 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50 define xbuffer
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51 print (struct buffer *) ($ & 0x00ffffff)
727
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 648
diff changeset
52 print &((struct Lisp_String *) (($->name) & 0x00ffffff))->data
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 648
diff changeset
53 print $$
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
54 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
55 document xbuffer
727
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 648
diff changeset
56 Set $ as a buffer pointer, assuming it is an Elisp buffer value.
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 648
diff changeset
57 Print the name of the buffer.
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
58 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
59
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 define xsymbol
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
61 print (struct Lisp_Symbol *) ($ & 0x00ffffff)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
62 print &$->name->data
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63 print $$
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
64 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
65 document xsymbol
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
66 Print the name and address of the symbol $.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
67 This command assumes that $ is an Elisp symbol value.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
68 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
69
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
70 define xstring
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
71 print (struct Lisp_String *) ($ & 0x00ffffff)
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
72 print ($->size > 10000) ? "big string" : ($->data[0])@($->size)
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
73 print $$
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
74 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
75 document xstring
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
76 Print the contents and address of the string $.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
77 This command assumes that $ is an Elisp string value.
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
78 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
79
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
80 define xvector
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
81 set $temp = (struct Lisp_Vector *) ($ & 0x00ffffff)
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
82 print ($temp->size > 10000) ? "big vector" : ($temp->contents[0])@($temp->size)
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
83 print $temp
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
84 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
85 document xvector
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
86 Print the contents and address of the vector $.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
87 This command assumes that $ is an Elisp vector value.
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
88 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
89
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
90 define xscreen
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
91 print (struct screen *) ($ & 0x00ffffff)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
92 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
93 document xwindow
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
94 Print $ as a screen pointer, assuming it is an Elisp screen value.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
95 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
96
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
97 define xcons
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
98 print (struct Lisp_Cons *) ($ & 0x00ffffff)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
99 print *$
648
70b112526394 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 638
diff changeset
100 print $$
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
101 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
102 document xcons
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
103 Print the contents of $, assuming it is an Elisp cons.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
104 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
105
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
106 define xcar
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
107 print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) ($ & 0x00ffffff))->car : 0)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
108 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
109 document xcar
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
110 Print the car of $, assuming it is an Elisp pair.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
111 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
112
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
113 define xcdr
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
114 print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) ($ & 0x00ffffff))->cdr : 0)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
115 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
116 document xcdr
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
117 Print the cdr of $, assuming it is an Elisp pair.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
118 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
119
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
120 set print pretty on
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
121
732
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
122 unset environment TERMCAP
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
123 unset environment TERM
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
124 set environment DISPLAY :0.0
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
125 show environment DISPLAY
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
126 set args -q
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
127
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
128 # Don't let abort actually run, as it will make
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
129 # stdio stop working and therefore the `pr' command below as well.
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
130 break abort
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
131
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
132 # If we are running in synchronous mode, we want a chance to look around
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
133 # before Emacs exits. Perhaps we should put the break somewhere else
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
134 # instead...
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
135 break _XPrintDefaultError
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
136