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