Mercurial > emacs
comparison src/.gdbinit @ 89909:68c22ea6027c
Sync to HEAD
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Fri, 16 Apr 2004 12:51:06 +0000 |
parents | 2f877ed80fa6 |
children | 4c90ffeb71c5 |
comparison
equal
deleted
inserted
replaced
89908:ee1402f7b568 | 89909:68c22ea6027c |
---|---|
1 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2003 | 1 # Copyright (C) 1992, 93, 94, 95, 96, 97, 1998, 2000, 01, 2004 |
2 # Free Software Foundation, Inc. | 2 # Free Software Foundation, Inc. |
3 # | 3 # |
4 # This file is part of GNU Emacs. | 4 # This file is part of GNU Emacs. |
5 # | 5 # |
6 # GNU Emacs is free software; you can redistribute it and/or modify | 6 # GNU Emacs is free software; you can redistribute it and/or modify |
36 handle SIGALRM ignore | 36 handle SIGALRM ignore |
37 | 37 |
38 # Set up a mask to use. | 38 # Set up a mask to use. |
39 # This should be EMACS_INT, but in some cases that is a macro. | 39 # This should be EMACS_INT, but in some cases that is a macro. |
40 # long ought to work in all cases right now. | 40 # long ought to work in all cases right now. |
41 set $valmask = ((long)1 << gdb_valbits) - 1 | 41 |
42 set $nonvalbits = gdb_emacs_intbits - gdb_valbits | 42 define xgetptr |
43 set $ptr = (gdb_use_union ? $arg0.u.val : $arg0 & $valmask) | gdb_data_seg_bits | |
44 end | |
45 | |
46 define xgetint | |
47 set $int = gdb_use_union ? $arg0.s.val : (gdb_use_lsb ? $arg0 : $arg0 << gdb_gctypebits) >> gdb_gctypebits | |
48 end | |
49 | |
50 define xgettype | |
51 set $type = gdb_use_union ? $arg0.s.type : (enum Lisp_Type) (gdb_use_lsb ? $arg0 & $tagmask : $arg0 >> gdb_valbits) | |
52 end | |
43 | 53 |
44 # Set up something to print out s-expressions. | 54 # Set up something to print out s-expressions. |
45 define pr | 55 define pr |
46 set debug_print ($) | 56 set debug_print ($) |
47 end | 57 end |
48 document pr | 58 document pr |
49 Print the emacs s-expression which is $. | 59 Print the emacs s-expression which is $. |
50 Works only when an inferior emacs is executing. | 60 Works only when an inferior emacs is executing. |
51 end | 61 end |
52 | 62 |
53 define xtype | 63 define xtype |
54 output (enum Lisp_Type) (($ >> gdb_valbits) & 0x7) | 64 xgettype $ |
55 echo \n | 65 output $type |
56 output ((($ >> gdb_valbits) & 0x7) == Lisp_Misc ? (enum Lisp_Misc_Type) (((struct Lisp_Free *) (($ & $valmask) | gdb_data_seg_bits))->type) : (($ >> gdb_valbits) & 0x7) == Lisp_Vectorlike ? ($size = ((struct Lisp_Vector *) (($ & $valmask) | gdb_data_seg_bits))->size, (enum pvec_type) (($size & PVEC_FLAG) ? $size & PVEC_TYPE_MASK : 0)) : 0) | 66 echo \n |
57 echo \n | 67 if $type == Lisp_Misc |
68 xmisctype | |
69 else | |
70 if $type == Lisp_Vectorlike | |
71 xvectype | |
72 end | |
73 end | |
58 end | 74 end |
59 document xtype | 75 document xtype |
60 Print the type of $, assuming it is an Emacs Lisp value. | 76 Print the type of $, assuming it is an Emacs Lisp value. |
61 If the first type printed is Lisp_Vector or Lisp_Misc, | 77 If the first type printed is Lisp_Vector or Lisp_Misc, |
62 the second line gives the more precise type. | 78 a second line gives the more precise type. |
63 Otherwise the second line doesn't mean anything. | |
64 end | 79 end |
65 | 80 |
66 define xvectype | 81 define xvectype |
67 set $size = ((struct Lisp_Vector *) (($ & $valmask) | gdb_data_seg_bits))->size | 82 xgetptr $ |
68 output (enum pvec_type) (($size & PVEC_FLAG) ? $size & PVEC_TYPE_MASK : 0) | 83 set $size = ((struct Lisp_Vector *) $ptr)->size |
69 echo \n | 84 output ($size & PVEC_FLAG) ? (enum pvec_type) ($size & PVEC_TYPE_MASK) : $size |
85 echo \n | |
70 end | 86 end |
71 document xvectype | 87 document xvectype |
72 Print the vector subtype of $, assuming it is a vector or pseudovector. | 88 Print the size or vector subtype of $, assuming it is a vector or pseudovector. |
73 end | 89 end |
74 | 90 |
75 define xmisctype | 91 define xmisctype |
76 output (enum Lisp_Misc_Type) (((struct Lisp_Free *) (($ & $valmask) | gdb_data_seg_bits))->type) | 92 xgetptr $ |
77 echo \n | 93 output (enum Lisp_Misc_Type) (((struct Lisp_Free *) $ptr)->type) |
94 echo \n | |
78 end | 95 end |
79 document xmisctype | 96 document xmisctype |
80 Print the specific type of $, assuming it is some misc type. | 97 Print the specific type of $, assuming it is some misc type. |
81 end | 98 end |
82 | 99 |
83 define xint | 100 define xint |
84 print (($ & $valmask) << $nonvalbits) >> $nonvalbits | 101 xgetint $ |
102 print $int | |
85 end | 103 end |
86 document xint | 104 document xint |
87 Print $, assuming it is an Emacs Lisp integer. This gets the sign right. | 105 Print $, assuming it is an Emacs Lisp integer. This gets the sign right. |
88 end | 106 end |
89 | 107 |
90 define xptr | 108 define xptr |
91 print (void *) (($ & $valmask) | gdb_data_seg_bits) | 109 xgetptr $ |
110 print (void *) $ptr | |
92 end | 111 end |
93 document xptr | 112 document xptr |
94 Print the pointer portion of $, assuming it is an Emacs Lisp value. | 113 Print the pointer portion of $, assuming it is an Emacs Lisp value. |
95 end | 114 end |
96 | 115 |
97 define xmarker | 116 define xmarker |
98 print (struct Lisp_Marker *) (($ & $valmask) | gdb_data_seg_bits) | 117 xgetptr $ |
118 print (struct Lisp_Marker *) $ptr | |
99 end | 119 end |
100 document xmarker | 120 document xmarker |
101 Print $ as a marker pointer, assuming it is an Emacs Lisp marker value. | 121 Print $ as a marker pointer, assuming it is an Emacs Lisp marker value. |
102 end | 122 end |
103 | 123 |
104 define xoverlay | 124 define xoverlay |
105 print (struct Lisp_Overlay *) (($ & $valmask) | gdb_data_seg_bits) | 125 xgetptr $ |
126 print (struct Lisp_Overlay *) $ptr | |
106 end | 127 end |
107 document xoverlay | 128 document xoverlay |
108 Print $ as a overlay pointer, assuming it is an Emacs Lisp overlay value. | 129 Print $ as a overlay pointer, assuming it is an Emacs Lisp overlay value. |
109 end | 130 end |
110 | 131 |
111 define xmiscfree | 132 define xmiscfree |
112 print (struct Lisp_Free *) (($ & $valmask) | gdb_data_seg_bits) | 133 xgetptr $ |
134 print (struct Lisp_Free *) $ptr | |
113 end | 135 end |
114 document xmiscfree | 136 document xmiscfree |
115 Print $ as a misc free-cell pointer, assuming it is an Emacs Lisp Misc value. | 137 Print $ as a misc free-cell pointer, assuming it is an Emacs Lisp Misc value. |
116 end | 138 end |
117 | 139 |
118 define xintfwd | 140 define xintfwd |
119 print (struct Lisp_Intfwd *) (($ & $valmask) | gdb_data_seg_bits) | 141 xgetptr $ |
142 print (struct Lisp_Intfwd *) $ptr | |
120 end | 143 end |
121 document xintfwd | 144 document xintfwd |
122 Print $ as an integer forwarding pointer, assuming it is an Emacs Lisp Misc value. | 145 Print $ as an integer forwarding pointer, assuming it is an Emacs Lisp Misc value. |
123 end | 146 end |
124 | 147 |
125 define xboolfwd | 148 define xboolfwd |
126 print (struct Lisp_Boolfwd *) (($ & $valmask) | gdb_data_seg_bits) | 149 xgetptr $ |
150 print (struct Lisp_Boolfwd *) $ptr | |
127 end | 151 end |
128 document xboolfwd | 152 document xboolfwd |
129 Print $ as a boolean forwarding pointer, assuming it is an Emacs Lisp Misc value. | 153 Print $ as a boolean forwarding pointer, assuming it is an Emacs Lisp Misc value. |
130 end | 154 end |
131 | 155 |
132 define xobjfwd | 156 define xobjfwd |
133 print (struct Lisp_Objfwd *) (($ & $valmask) | gdb_data_seg_bits) | 157 xgetptr $ |
158 print (struct Lisp_Objfwd *) $ptr | |
134 end | 159 end |
135 document xobjfwd | 160 document xobjfwd |
136 Print $ as an object forwarding pointer, assuming it is an Emacs Lisp Misc value. | 161 Print $ as an object forwarding pointer, assuming it is an Emacs Lisp Misc value. |
137 end | 162 end |
138 | 163 |
139 define xbufobjfwd | 164 define xbufobjfwd |
140 print (struct Lisp_Buffer_Objfwd *) (($ & $valmask) | gdb_data_seg_bits) | 165 xgetptr $ |
166 print (struct Lisp_Buffer_Objfwd *) $ptr | |
141 end | 167 end |
142 document xbufobjfwd | 168 document xbufobjfwd |
143 Print $ as a buffer-local object forwarding pointer, assuming it is an Emacs Lisp Misc value. | 169 Print $ as a buffer-local object forwarding pointer, assuming it is an Emacs Lisp Misc value. |
144 end | 170 end |
145 | 171 |
146 define xkbobjfwd | 172 define xkbobjfwd |
147 print (struct Lisp_Kboard_Objfwd *) (($ & $valmask) | gdb_data_seg_bits) | 173 xgetptr $ |
174 print (struct Lisp_Kboard_Objfwd *) $ptr | |
148 end | 175 end |
149 document xkbobjfwd | 176 document xkbobjfwd |
150 Print $ as a kboard-local object forwarding pointer, assuming it is an Emacs Lisp Misc value. | 177 Print $ as a kboard-local object forwarding pointer, assuming it is an Emacs Lisp Misc value. |
151 end | 178 end |
152 | 179 |
153 define xbuflocal | 180 define xbuflocal |
154 print (struct Lisp_Buffer_Local_Value *) (($ & $valmask) | gdb_data_seg_bits) | 181 xgetptr $ |
182 print (struct Lisp_Buffer_Local_Value *) $ptr | |
155 end | 183 end |
156 document xbuflocal | 184 document xbuflocal |
157 Print $ as a buffer-local-value pointer, assuming it is an Emacs Lisp Misc value. | 185 Print $ as a buffer-local-value pointer, assuming it is an Emacs Lisp Misc value. |
158 end | 186 end |
159 | 187 |
160 define xsymbol | 188 define xsymbol |
161 print (struct Lisp_Symbol *) ((((int) $) & $valmask) | gdb_data_seg_bits) | 189 xgetptr $ |
162 xprintsym $ | 190 print (struct Lisp_Symbol *) $ptr |
191 xprintsym $ | |
192 echo \n | |
163 end | 193 end |
164 document xsymbol | 194 document xsymbol |
165 Print the name and address of the symbol $. | 195 Print the name and address of the symbol $. |
166 This command assumes that $ is an Emacs Lisp symbol value. | 196 This command assumes that $ is an Emacs Lisp symbol value. |
167 end | 197 end |
168 | 198 |
169 define xstring | 199 define xstring |
170 print (struct Lisp_String *) (($ & $valmask) | gdb_data_seg_bits) | 200 xgetptr $ |
171 output ($->size > 1000) ? 0 : ($->data[0])@($->size_byte < 0 ? $->size : $->size_byte) | 201 print (struct Lisp_String *) $ptr |
172 echo \n | 202 output ($->size > 1000) ? 0 : ($->data[0])@($->size_byte < 0 ? $->size : $->size_byte) |
203 echo \n | |
173 end | 204 end |
174 document xstring | 205 document xstring |
175 Print the contents and address of the string $. | 206 Print the contents and address of the string $. |
176 This command assumes that $ is an Emacs Lisp string value. | 207 This command assumes that $ is an Emacs Lisp string value. |
177 end | 208 end |
178 | 209 |
179 define xvector | 210 define xvector |
180 print (struct Lisp_Vector *) (($ & $valmask) | gdb_data_seg_bits) | 211 xgetptr $ |
181 output ($->size > 50) ? 0 : ($->contents[0])@($->size) | 212 print (struct Lisp_Vector *) $ptr |
213 output ($->size > 50) ? 0 : ($->contents[0])@($->size) | |
182 echo \n | 214 echo \n |
183 end | 215 end |
184 document xvector | 216 document xvector |
185 Print the contents and address of the vector $. | 217 Print the contents and address of the vector $. |
186 This command assumes that $ is an Emacs Lisp vector value. | 218 This command assumes that $ is an Emacs Lisp vector value. |
187 end | 219 end |
188 | 220 |
189 define xprocess | 221 define xprocess |
190 print (struct Lisp_Process *) (($ & $valmask) | gdb_data_seg_bits) | 222 xgetptr $ |
191 output *$ | 223 print (struct Lisp_Process *) $ptr |
192 echo \n | 224 output *$ |
225 echo \n | |
193 end | 226 end |
194 document xprocess | 227 document xprocess |
195 Print the address of the struct Lisp_process which the Lisp_Object $ points to. | 228 Print the address of the struct Lisp_process which the Lisp_Object $ points to. |
196 end | 229 end |
197 | 230 |
198 define xframe | 231 define xframe |
199 print (struct frame *) (($ & $valmask) | gdb_data_seg_bits) | 232 xgetptr $ |
233 print (struct frame *) $ptr | |
200 end | 234 end |
201 document xframe | 235 document xframe |
202 Print $ as a frame pointer, assuming it is an Emacs Lisp frame value. | 236 Print $ as a frame pointer, assuming it is an Emacs Lisp frame value. |
203 end | 237 end |
204 | 238 |
205 define xcompiled | 239 define xcompiled |
206 print (struct Lisp_Vector *) (($ & $valmask) | gdb_data_seg_bits) | 240 xgetptr $ |
207 output ($->contents[0])@($->size & 0xff) | 241 print (struct Lisp_Vector *) $ptr |
242 output ($->contents[0])@($->size & 0xff) | |
208 end | 243 end |
209 document xcompiled | 244 document xcompiled |
210 Print $ as a compiled function pointer, assuming it is an Emacs Lisp compiled value. | 245 Print $ as a compiled function pointer, assuming it is an Emacs Lisp compiled value. |
211 end | 246 end |
212 | 247 |
213 define xwindow | 248 define xwindow |
214 print (struct window *) (($ & $valmask) | gdb_data_seg_bits) | 249 xgetptr $ |
215 printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top | 250 print (struct window *) $ptr |
251 printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top | |
216 end | 252 end |
217 document xwindow | 253 document xwindow |
218 Print $ as a window pointer, assuming it is an Emacs Lisp window value. | 254 Print $ as a window pointer, assuming it is an Emacs Lisp window value. |
219 Print the window's position as "WIDTHxHEIGHT+LEFT+TOP". | 255 Print the window's position as "WIDTHxHEIGHT+LEFT+TOP". |
220 end | 256 end |
221 | 257 |
222 define xwinconfig | 258 define xwinconfig |
223 print (struct save_window_data *) (($ & $valmask) | gdb_data_seg_bits) | 259 xgetptr $ |
260 print (struct save_window_data *) $ptr | |
224 end | 261 end |
225 document xwinconfig | 262 document xwinconfig |
226 Print $ as a window configuration pointer, assuming it is an Emacs Lisp window configuration value. | 263 Print $ as a window configuration pointer, assuming it is an Emacs Lisp window configuration value. |
227 end | 264 end |
228 | 265 |
229 define xsubr | 266 define xsubr |
230 print (struct Lisp_Subr *) (($ & $valmask) | gdb_data_seg_bits) | 267 xgetptr $ |
231 output *$ | 268 print (struct Lisp_Subr *) $ptr |
232 echo \n | 269 output *$ |
270 echo \n | |
233 end | 271 end |
234 document xsubr | 272 document xsubr |
235 Print the address of the subr which the Lisp_Object $ points to. | 273 Print the address of the subr which the Lisp_Object $ points to. |
236 end | 274 end |
237 | 275 |
238 define xchartable | 276 define xchartable |
239 print (struct Lisp_Char_Table *) (($ & $valmask) | gdb_data_seg_bits) | 277 xgetptr $ |
240 printf " %d extra slots", ($->size & 0x1ff) - 68 | 278 print (struct Lisp_Char_Table *) $ptr |
241 echo \n | 279 printf "Purpose: " |
242 printf "Purpose: " | 280 xprintsym $->purpose |
243 xprintsym $->purpose | 281 printf " %d extra slots", ($->size & 0x1ff) - 68 |
282 echo \n | |
244 end | 283 end |
245 document xchartable | 284 document xchartable |
246 Print the address of the char-table $, and its purpose. | 285 Print the address of the char-table $, and its purpose. |
247 This command assumes that $ is an Emacs Lisp char-table value. | 286 This command assumes that $ is an Emacs Lisp char-table value. |
248 end | 287 end |
249 | 288 |
250 define xboolvector | 289 define xboolvector |
251 print (struct Lisp_Bool_Vector *) (($ & $valmask) | gdb_data_seg_bits) | 290 xgetptr $ |
252 output ($->size > 256) ? 0 : ($->data[0])@(($->size + 7)/ 8) | 291 print (struct Lisp_Bool_Vector *) $ptr |
253 echo \n | 292 output ($->size > 256) ? 0 : ($->data[0])@(($->size + 7)/ 8) |
293 echo \n | |
254 end | 294 end |
255 document xboolvector | 295 document xboolvector |
256 Print the contents and address of the bool-vector $. | 296 Print the contents and address of the bool-vector $. |
257 This command assumes that $ is an Emacs Lisp bool-vector value. | 297 This command assumes that $ is an Emacs Lisp bool-vector value. |
258 end | 298 end |
259 | 299 |
260 define xbuffer | 300 define xbuffer |
261 print (struct buffer *) (($ & $valmask) | gdb_data_seg_bits) | 301 xgetptr $ |
262 output ((struct Lisp_String *) ((($->name) & $valmask) | gdb_data_seg_bits))->data | 302 print (struct buffer *) $ptr |
263 echo \n | 303 xgetptr $->name |
304 output ((struct Lisp_String *) $ptr)->data | |
305 echo \n | |
264 end | 306 end |
265 document xbuffer | 307 document xbuffer |
266 Set $ as a buffer pointer, assuming it is an Emacs Lisp buffer value. | 308 Set $ as a buffer pointer, assuming it is an Emacs Lisp buffer value. |
267 Print the name of the buffer. | 309 Print the name of the buffer. |
268 end | 310 end |
269 | 311 |
270 define xhashtable | 312 define xhashtable |
271 print (struct Lisp_Hash_Table *) (($ & $valmask) | gdb_data_seg_bits) | 313 xgetptr $ |
314 print (struct Lisp_Hash_Table *) $ptr | |
272 end | 315 end |
273 document xhashtable | 316 document xhashtable |
274 Set $ as a hash table pointer, assuming it is an Emacs Lisp hash table value. | 317 Set $ as a hash table pointer, assuming it is an Emacs Lisp hash table value. |
275 end | 318 end |
276 | 319 |
277 define xcons | 320 define xcons |
278 print (struct Lisp_Cons *) (($ & $valmask) | gdb_data_seg_bits) | 321 xgetptr $ |
279 output/x *$ | 322 print (struct Lisp_Cons *) $ptr |
280 echo \n | 323 output/x *$ |
324 echo \n | |
281 end | 325 end |
282 document xcons | 326 document xcons |
283 Print the contents of $, assuming it is an Emacs Lisp cons. | 327 Print the contents of $, assuming it is an Emacs Lisp cons. |
284 end | 328 end |
285 | 329 |
286 define nextcons | 330 define nextcons |
287 p $.cdr | 331 p $.cdr |
288 xcons | 332 xcons |
289 end | 333 end |
290 document nextcons | 334 document nextcons |
291 Print the contents of the next cell in a list. | 335 Print the contents of the next cell in a list. |
292 This assumes that the last thing you printed was a cons cell contents | 336 This assumes that the last thing you printed was a cons cell contents |
293 (type struct Lisp_Cons) or a pointer to one. | 337 (type struct Lisp_Cons) or a pointer to one. |
294 end | 338 end |
295 define xcar | 339 define xcar |
296 print/x ((($ >> gdb_valbits) & 0xf) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & $valmask) | gdb_data_seg_bits))->car : 0) | 340 xgetptr $ |
341 xgettype $ | |
342 print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->car : 0) | |
297 end | 343 end |
298 document xcar | 344 document xcar |
299 Print the car of $, assuming it is an Emacs Lisp pair. | 345 Print the car of $, assuming it is an Emacs Lisp pair. |
300 end | 346 end |
301 | 347 |
302 define xcdr | 348 define xcdr |
303 print/x ((($ >> gdb_valbits) & 0xf) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & $valmask) | gdb_data_seg_bits))->cdr : 0) | 349 xgetptr $ |
350 xgettype $ | |
351 print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->cdr : 0) | |
304 end | 352 end |
305 document xcdr | 353 document xcdr |
306 Print the cdr of $, assuming it is an Emacs Lisp pair. | 354 Print the cdr of $, assuming it is an Emacs Lisp pair. |
307 end | 355 end |
308 | 356 |
309 define xfloat | 357 define xfloat |
310 print ((struct Lisp_Float *) (($ & $valmask) | gdb_data_seg_bits))->data | 358 xgetptr $ |
359 print ((struct Lisp_Float *) $ptr)->data | |
311 end | 360 end |
312 document xfloat | 361 document xfloat |
313 Print $ assuming it is a lisp floating-point number. | 362 Print $ assuming it is a lisp floating-point number. |
314 end | 363 end |
315 | 364 |
316 define xscrollbar | 365 define xscrollbar |
317 print (struct scrollbar *) (($ & $valmask) | gdb_data_seg_bits) | 366 xgetptr $ |
367 print (struct scrollbar *) $ptr | |
318 output *$ | 368 output *$ |
319 echo \n | 369 echo \n |
320 end | 370 end |
321 document xscrollbar | 371 document xscrollbar |
322 Print $ as a scrollbar pointer. | 372 Print $ as a scrollbar pointer. |
323 end | 373 end |
324 | 374 |
325 define xprintsym | 375 define xprintsym |
326 set $sym = (struct Lisp_Symbol *) ((((int) $arg0) & $valmask) | gdb_data_seg_bits) | 376 xgetptr $arg0 |
327 set $sym_name = ((struct Lisp_String *)(($sym->xname & $valmask) | gdb_data_seg_bits)) | 377 set $sym = (struct Lisp_Symbol *) $ptr |
378 xgetptr $sym->xname | |
379 set $sym_name = (struct Lisp_String *) $ptr | |
328 output ($sym_name->data[0])@($sym_name->size_byte < 0 ? $sym_name->size : $sym_name->size_byte) | 380 output ($sym_name->data[0])@($sym_name->size_byte < 0 ? $sym_name->size : $sym_name->size_byte) |
329 echo \n | |
330 end | 381 end |
331 document xprintsym | 382 document xprintsym |
332 Print argument as a symbol. | 383 Print argument as a symbol. |
333 end | 384 end |
334 | 385 |
356 end | 407 end |
357 | 408 |
358 define xbacktrace | 409 define xbacktrace |
359 set $bt = backtrace_list | 410 set $bt = backtrace_list |
360 while $bt | 411 while $bt |
361 set $type = (enum Lisp_Type) ((*$bt->function >> gdb_valbits) & 0x7) | 412 xgettype (*$bt->function) |
362 if $type == Lisp_Symbol | 413 if $type == Lisp_Symbol |
363 xprintsym *$bt->function | 414 xprintsym (*$bt->function) |
415 echo \n | |
364 else | 416 else |
365 printf "0x%x ", *$bt->function | 417 printf "0x%x ", *$bt->function |
366 if $type == Lisp_Vectorlike | 418 if $type == Lisp_Vectorlike |
367 set $size = ((struct Lisp_Vector *) ((*$bt->function & $valmask) | gdb_data_seg_bits))->size | 419 xgetptr (*$bt->function) |
368 output (enum pvec_type) (($size & PVEC_FLAG) ? $size & PVEC_TYPE_MASK : 0) | 420 set $size = ((struct Lisp_Vector *) $ptr)->size |
421 output ($size & PVEC_FLAG) ? (enum pvec_type) ($size & PVEC_TYPE_MASK) : $size | |
369 else | 422 else |
370 printf "Lisp type %d", $type | 423 printf "Lisp type %d", $type |
371 end | 424 end |
372 echo \n | 425 echo \n |
373 end | 426 end |
379 Set a breakpoint at Fsignal and call this to see from where | 432 Set a breakpoint at Fsignal and call this to see from where |
380 an error was signaled. | 433 an error was signaled. |
381 end | 434 end |
382 | 435 |
383 define xreload | 436 define xreload |
384 set $valmask = ((long)1 << gdb_valbits) - 1 | 437 set $tagmask = (((long)1 << gdb_gctypebits) - 1) |
385 set $nonvalbits = gdb_emacs_intbits - gdb_valbits | 438 set $valmask = gdb_use_lsb ? ~($tagmask) : ((long)1 << gdb_valbits) - 1 |
386 end | 439 end |
387 document xreload | 440 document xreload |
388 When starting Emacs a second time in the same gdb session under | 441 When starting Emacs a second time in the same gdb session under |
389 FreeBSD 2.2.5, gdb 4.13, $valmask and $nonvalbits have lost | 442 FreeBSD 2.2.5, gdb 4.13, $valmask have lost |
390 their values. (The same happens on current (2000) versions of GNU/Linux | 443 their values. (The same happens on current (2000) versions of GNU/Linux |
391 with gdb 5.0.) | 444 with gdb 5.0.) |
392 This function reloads them. | 445 This function reloads them. |
393 end | 446 end |
447 xreload | |
394 | 448 |
395 define hook-run | 449 define hook-run |
396 xreload | 450 xreload |
397 end | 451 end |
398 | 452 |
414 | 468 |
415 # If we are running in synchronous mode, we want a chance to look around | 469 # If we are running in synchronous mode, we want a chance to look around |
416 # before Emacs exits. Perhaps we should put the break somewhere else | 470 # before Emacs exits. Perhaps we should put the break somewhere else |
417 # instead... | 471 # instead... |
418 break x_error_quitter | 472 break x_error_quitter |
473 | |
474 # arch-tag: 12f34321-7bfa-4240-b77a-3cd3a1696dfe |