comparison src/gdbinit.pre-4.14 @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:376386a54a3c
1 # Some useful commands for debugging XEmacs with gdb 4.* or better.
2 # If you have gdb 4.14 or better, you should use the version provided
3 # for that debugger -- it's much easier to use. See that file
4 # (called "gdbinit" in the src/ directory of the XEmacs 19.14+ distribution)
5 # for more info.
6 #
7 # Used on machines with NO_UNION_TYPE defined (everyone except DEC Alpha).
8
9 set print union off
10 set print pretty off
11
12 define temacs
13 run -batch -l loadup.el run-temacs -q
14 end
15
16 echo \n>>> Use the `temacs' command to run temacs\n\n
17
18 # if you use Purify, do this:
19 # set env PURIFYOPTIONS -pointer-mask=0x0fffffff
20
21 # was frob, but p1 is short for prin1
22 define p1
23 call debug_print ($)
24 end
25
26 define lbt
27 call Fbacktrace (Qexternal_debugging_output, Qt)
28 end
29
30
31 set $vector_length_mask = ~(1<<31)
32
33 define xtype
34 # this is really xgctype, as we mask off the mark bit
35 output (enum Lisp_Type) (($ >> 28) & 7)
36 echo \n
37 end
38
39 define xint
40 print ((int)($1 << 4))>>4
41 end
42
43 define xmarkbit
44 print ($1 >> 31)
45 end
46
47 define xrecord
48 print (struct lrecord_header *) ($ & 0xFFFFFFF)
49 output *($->implementation)
50 echo \n
51 end
52
53 define xbitvec
54 print (struct Lisp_Bit_Vector *) ($ & 0xFFFFFFF)
55 end
56
57 define xbuffer
58 print (struct buffer *) ($ & 0xFFFFFFF)
59 end
60
61 define xbytecode
62 print (struct Lisp_Bytecode *) ($ & 0xFFFFFFF)
63 end
64
65 define xcharset
66 print (struct Lisp_Charset *) ($ & 0xFFFFFFF)
67 end
68
69 define xchartab
70 print (struct Lisp_Char_Table *) ($ & 0xFFFFFFF)
71 end
72
73 define xchartabentry
74 print (struct Lisp_Char_Table_Entry *) ($ & 0xFFFFFFF)
75 end
76
77 define xcodesys
78 print (struct Lisp_Coding_System *) ($ & 0xFFFFFFF)
79 end
80
81 define xcolorinst
82 print (struct Lisp_Color_Instance *) ($ & 0xFFFFFFF)
83 end
84
85 define xcons
86 print (struct Lisp_Cons *) ($ & 0xFFFFFFF)
87 end
88
89 define xcursor
90 print (struct Lisp_Cursor *) ($ & 0xFFFFFFF)
91 end
92
93 define xdevice
94 print (struct device *) ($ & 0xFFFFFFF)
95 end
96
97 define xevent
98 print (struct Lisp_Event *) ($ & 0xFFFFFFF)
99 end
100
101 define xextent
102 print (struct extent *) ($ & 0xFFFFFFF)
103 end
104
105 define xextentaux
106 print (struct extent_auxiliary *) ($ & 0xFFFFFFF)
107 end
108
109 define xextentinfo
110 print (struct extent_info *) ($ & 0xFFFFFFF)
111 end
112
113 define xfloat
114 print (struct Lisp_Float *) ($ & 0xFFFFFFF)
115 output (double) $->data.d
116 echo \n
117 end
118
119 define xfontinst
120 print (struct Lisp_Font_Instance *) ($ & 0xFFFFFFF)
121 end
122
123 define xframe
124 print (struct frame *) ($ & 0xFFFFFFF)
125 end
126
127 define xglyph
128 print (struct Lisp_Glyph *) ($ & 0xFFFFFFF)
129 end
130
131 define xhashtable
132 print (struct hashtable_struct *) ($ & 0xFFFFFFF)
133 end
134
135 define ximageinst
136 print (struct Lisp_Image_Instance *) ($ & 0xFFFFFFF)
137 end
138
139 define xkeymap
140 print (struct keymap *) ($ & 0xFFFFFFF)
141 end
142
143 define xlstream
144 print (struct lstream *) ($ & 0xFFFFFFF)
145 end
146
147 define xmarker
148 print (struct Lisp_Marker *) ($ & 0xFFFFFFF)
149 end
150
151 define xmenubardata
152 print (struct menubar_data *) ($ & 0xFFFFFFF)
153 end
154
155 define xopaque
156 print (struct Lisp_Opaque *) ($ & 0xFFFFFFF)
157 end
158
159 define xprocess
160 print (struct Lisp_Process *) ($ & 0xFFFFFFF)
161 end
162
163 define xrangetab
164 print (struct Lisp_Range_Table *) ($ & 0xFFFFFFF)
165 end
166
167 define xspec
168 print (struct Lisp_Specifier *) ($ & 0xFFFFFFF)
169 end
170
171 define xstring
172 print (struct Lisp_String *) ($ & 0xFFFFFFF)
173 output (char *) $->_data
174 echo \n
175 end
176
177 define xsubr
178 print (struct Lisp_Subr *) ($ & 0xFFFFFFF)
179 end
180
181 define xsubwindow
182 print (struct Lisp_Subwindow *) ($ & 0xFFFFFFF)
183 end
184
185 define xtoolbarbutton
186 print (struct toolbar_button *) ($ & 0xFFFFFFF)
187 end
188
189 define xtoolbardata
190 print (struct toolbar_data *) ($ & 0xFFFFFFF)
191 end
192
193 define xtooltalkmess
194 print (struct Lisp_Tooltalk_Message *) ($ & 0xFFFFFFF)
195 end
196
197 define xtooltalkpatt
198 print (struct Lisp_Tooltalk_Pattern *) ($ & 0xFFFFFFF)
199 end
200
201 define xvector
202 print (struct Lisp_Vector *) ($ & 0xFFFFFFF)
203 end
204
205 define xwindow
206 print (struct window *) ($ & 0xFFFFFFF)
207 end
208
209 define xwindowconfig
210 print (struct window_config *) ($ & 0xFFFFFFF)
211 end
212
213 define nilp
214 print $ == Qnil
215 end
216
217 define car
218 set $tem = ((struct Lisp_Cons *) ($ & 0xFFFFFFF))->car
219 end
220
221 define cdr
222 set $tem = ((struct Lisp_Cons *) ($ & 0xFFFFFFF))->cdr
223 end
224
225 define string-length
226 print ((struct Lisp_String *) ($ & 0xFFFFFFF))->_size & $vector_length_mask
227 end
228
229 define string-contents
230 print (char *) ((struct Lisp_String *) ($ & 0xFFFFFFF))->_data
231 end
232
233 define vector-length
234 print ((struct Lisp_Vector *) ($ & 0xFFFFFFF))->size & $vector_length_mask
235 end
236
237 define vector-contents
238 set $tem = (struct Lisp_Vector *) ($ & 0xFFFFFFF)
239 print *($tem->contents) @ ($tem->size & $vector_length_mask)
240 set $ = $tem->contents
241 end
242
243 define symbol-name
244 set $tem = ((struct Lisp_Symbol *) ($ & 0xFFFFFFF))->name
245 # output *($tem->_data) @ ($tem->_size & $vector_length_mask)
246 output ($tem->_data)
247 echo \n
248 set $type = Lisp_String
249 echo \n
250 end
251
252 define xsymbol
253 symbol-name
254 end
255
256 define symbol-value
257 set $tem = ((struct Lisp_Symbol *) ($ & 0xFFFFFFF))->value
258 end
259
260 define symbol-function
261 set $tem = ((struct Lisp_Symbol *) ($ & 0xFFFFFFF))->function
262 end
263
264 define symbol-plist
265 set $tem = ((struct Lisp_Symbol *) ($ & 0xFFFFFFF))->plist
266 end
267
268 define wtype
269 p $->core.widget_class->core_class.class_name
270 end
271
272 define xtname
273 print XrmQuarkToString(((Object)($))->object.xrm_name)
274 end
275
276 #
277 # GDB, with the losing command-line parser that it has,
278 # cannot handle nested blocks.
279 #
280 define breaks
281
282 br Fsignal
283 # command
284 # bt 3
285 # p sig
286 # xsymbol
287 # end
288
289 br Fkill_emacs
290 # command
291 # bt 3
292 # end
293
294 br assertion_failed
295 # command
296 # bt 3
297 # end
298
299 end