(auto-mode-alist): Add entries for .cls files,
[bpt/emacs.git] / src / .gdbinit
CommitLineData
a6ffc6a2
JB
1# Set up something to print out s-expressions.
2define pr
36fa5981 3set debug_print ($)
a6ffc6a2
JB
4echo \n
5end
a6ffc6a2
JB
6document pr
7Print the emacs s-expression which is $.
8Works only when an inferior emacs is executing.
9end
10
ec558adc
JB
11# Set this to the same thing as the DATA_SEG_BITS macro in your
12# machine-description files.
13set $data_seg_bits = 0
14
45c18993
JB
15define mips
16set $data_seg_bits = 0x10000000
17end
18document mips
19Set up the xfoo macros to deal with the MIPS processor.
20Specifically, this sets $data_seg_bits to the right thing.
21end
22
a6ffc6a2 23define xtype
ef15f270
JB
24output (enum Lisp_Type) (($ >> 24) & 0x7f)
25echo \n
a6ffc6a2 26end
e065a56e 27document xtype
ba1e23bf 28Print the type of $, assuming it is an Emacs Lisp value.
e065a56e 29end
a6ffc6a2
JB
30
31define xint
32print (($ & 0x00ffffff) << 8) >> 8
33end
e065a56e 34document xint
ba1e23bf 35Print $, assuming it is an Emacs Lisp integer. This gets the sign right.
e065a56e 36end
a6ffc6a2
JB
37
38define xptr
ec558adc 39print (void *) (($ & 0x00ffffff) | $data_seg_bits)
a6ffc6a2 40end
e065a56e 41document xptr
ba1e23bf 42Print the pointer portion of $, assuming it is an Emacs Lisp value.
e065a56e 43end
a6ffc6a2
JB
44
45define xwindow
ec558adc 46print (struct window *) (($ & 0x00ffffff) | $data_seg_bits)
ef15f270 47printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top
a6ffc6a2 48end
e065a56e 49document xwindow
ba1e23bf 50Print $ as a window pointer, assuming it is an Emacs Lisp window value.
ef15f270 51Print the window's position as "WIDTHxHEIGHT+LEFT+TOP".
e065a56e 52end
a6ffc6a2
JB
53
54define xmarker
ec558adc 55print (struct Lisp_Marker *) (($ & 0x00ffffff) | $data_seg_bits)
a6ffc6a2 56end
e065a56e 57document xmarker
ba1e23bf 58Print $ as a marker pointer, assuming it is an Emacs Lisp marker value.
e065a56e 59end
a6ffc6a2
JB
60
61define xbuffer
ec558adc
JB
62print (struct buffer *) (($ & 0x00ffffff) | $data_seg_bits)
63output &((struct Lisp_String *) ((($->name) & 0x00ffffff) | $data_seg_bits))->data
ef15f270 64echo \n
a6ffc6a2 65end
e065a56e 66document xbuffer
ba1e23bf 67Set $ as a buffer pointer, assuming it is an Emacs Lisp buffer value.
daa37602 68Print the name of the buffer.
e065a56e 69end
a6ffc6a2
JB
70
71define xsymbol
4ea0847a 72print (struct Lisp_Symbol *) ((((int) $) & 0x00ffffff) | $data_seg_bits)
ef15f270
JB
73output &$->name->data
74echo \n
a6ffc6a2 75end
e065a56e
JB
76document xsymbol
77Print the name and address of the symbol $.
ba1e23bf 78This command assumes that $ is an Emacs Lisp symbol value.
e065a56e 79end
a6ffc6a2
JB
80
81define xstring
ec558adc 82print (struct Lisp_String *) (($ & 0x00ffffff) | $data_seg_bits)
4ea0847a 83output ($->size > 1000) ? 0 : ($->data[0])@($->size)
ef15f270 84echo \n
a6ffc6a2 85end
a6ffc6a2 86document xstring
e065a56e 87Print the contents and address of the string $.
ba1e23bf 88This command assumes that $ is an Emacs Lisp string value.
a6ffc6a2
JB
89end
90
91define xvector
ec558adc 92print (struct Lisp_Vector *) (($ & 0x00ffffff) | $data_seg_bits)
4ea0847a 93output ($->size > 50) ? 0 : ($->contents[0])@($->size)
ef15f270 94echo \n
a6ffc6a2 95end
a6ffc6a2 96document xvector
e065a56e 97Print the contents and address of the vector $.
ba1e23bf 98This command assumes that $ is an Emacs Lisp vector value.
a6ffc6a2
JB
99end
100
ec558adc
JB
101define xframe
102print (struct frame *) (($ & 0x00ffffff) | $data_seg_bits)
a6ffc6a2 103end
ec558adc 104document xframe
ba1e23bf 105Print $ as a frame pointer, assuming it is an Emacs Lisp frame value.
e065a56e 106end
a6ffc6a2
JB
107
108define xcons
ec558adc 109print (struct Lisp_Cons *) (($ & 0x00ffffff) | $data_seg_bits)
cac29370 110output *$
ef15f270 111echo \n
a6ffc6a2 112end
e065a56e 113document xcons
ba1e23bf 114Print the contents of $, assuming it is an Emacs Lisp cons.
e065a56e 115end
a6ffc6a2
JB
116
117define xcar
ec558adc 118print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & 0x00ffffff) | $data_seg_bits))->car : 0)
a6ffc6a2 119end
e065a56e 120document xcar
ba1e23bf 121Print the car of $, assuming it is an Emacs Lisp pair.
e065a56e 122end
a6ffc6a2
JB
123
124define xcdr
ec558adc 125print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & 0x00ffffff) | $data_seg_bits))->cdr : 0)
a6ffc6a2 126end
e065a56e 127document xcdr
ba1e23bf 128Print the cdr of $, assuming it is an Emacs Lisp pair.
e065a56e 129end
a6ffc6a2 130
ec558adc
JB
131define xsubr
132print (struct Lisp_Subr *) (($ & 0x00ffffff) | $data_seg_bits)
133output *$
134echo \n
135end
136document xsubr
137Print the address of the subr which the Lisp_Object $ points to.
138end
139
8dd926ca
JB
140define xprocess
141print (struct Lisp_Process *) (($ & 0x00ffffff) | $data_seg_bits)
142output *$
143echo \n
144end
145document xprocess
146Print the address of the struct Lisp_process which the Lisp_Object $ points to.
147end
148
df86e57e
JB
149define xfloat
150print ((struct Lisp_Float *) (($ & 0x00ffffff) | $data_seg_bits))->data
151end
152document xfloat
153Print $ assuming it is a lisp floating-point number.
154end
155
b2367490
JB
156define xscrollbar
157print (struct scrollbar *) (($ & 0x00ffffff) | $data_seg_bits)
158output *$
159echo \n
160end
dec5f4e3 161document xscrollbar
b2367490
JB
162Print $ as a scrollbar pointer.
163end
164
e065a56e 165set print pretty on
df86e57e 166set print sevenbit-strings
a6ffc6a2 167
e5d77022 168show environment DISPLAY
6f5d1a4f 169show environment TERM
6f5d1a4f 170set args -geometry 80x40+0+0
e5d77022 171
a6ffc6a2 172# Don't let abort actually run, as it will make
7f692070 173# stdio stop working and therefore the `pr' command above as well.
a6ffc6a2
JB
174break abort
175
176# If we are running in synchronous mode, we want a chance to look around
177# before Emacs exits. Perhaps we should put the break somewhere else
178# instead...
998ee976
RS
179break x_error_quitter
180
a6ffc6a2 181