Commit | Line | Data |
---|---|---|
aaef169d | 1 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001, |
29f1f001 | 2 | # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 |
0d5f855c | 3 | # Free Software Foundation, Inc. |
e3efab9c GM |
4 | # |
5 | # This file is part of GNU Emacs. | |
6 | # | |
7 | # GNU Emacs is free software; you can redistribute it and/or modify | |
8 | # it under the terms of the GNU General Public License as published by | |
684d6f5b | 9 | # the Free Software Foundation; either version 3, or (at your option) |
e3efab9c GM |
10 | # any later version. |
11 | # | |
12 | # GNU Emacs is distributed in the hope that it will be useful, | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | # GNU General Public License for more details. | |
16 | # | |
17 | # You should have received a copy of the GNU General Public License | |
18 | # along with GNU Emacs; see the file COPYING. If not, write to the | |
4fc5845f LK |
19 | # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 | # Boston, MA 02110-1301, USA. | |
e3efab9c | 21 | |
7faa0236 RS |
22 | # Force loading of symbols, enough to give us gdb_valbits etc. |
23 | set main | |
24 | ||
39d10e52 RS |
25 | # Find lwlib source files too. |
26 | dir ../lwlib | |
892d8fcd | 27 | #dir /gd/gnu/lesstif-0.89.9/lib/Xm |
39d10e52 | 28 | |
056515d8 KH |
29 | # Don't enter GDB when user types C-g to quit. |
30 | # This has one unfortunate effect: you can't type C-c | |
31 | # at the GDB to stop Emacs, when using X. | |
32 | # However, C-z works just as well in that case. | |
33 | handle 2 noprint pass | |
34 | ||
19b9d1de NR |
35 | # Make it work like SIGINT normally does. |
36 | handle SIGTSTP nopass | |
37 | ||
6a7d16fe KS |
38 | # Pass on user signals |
39 | handle SIGUSR1 noprint pass | |
40 | handle SIGUSR2 noprint pass | |
41 | ||
3266f62b GM |
42 | # Don't pass SIGALRM to Emacs. This makes problems when |
43 | # debugging. | |
44 | handle SIGALRM ignore | |
45 | ||
0e73312b | 46 | # $valmask and $tagmask are mask values set up by the xreload macro below. |
6b61353c | 47 | |
0e73312b RS |
48 | # Use $bugfix so that the value isn't a constant. |
49 | # Using a constant runs into GDB bugs sometimes. | |
6b61353c | 50 | define xgetptr |
0e73312b RS |
51 | set $bugfix = $arg0 |
52 | set $ptr = (gdb_use_union ? $bugfix.u.val : $bugfix & $valmask) | gdb_data_seg_bits | |
6b61353c KH |
53 | end |
54 | ||
55 | define xgetint | |
0e73312b RS |
56 | set $bugfix = $arg0 |
57 | set $int = gdb_use_union ? $bugfix.s.val : (gdb_use_lsb ? $bugfix : $bugfix << gdb_gctypebits) >> gdb_gctypebits | |
6b61353c KH |
58 | end |
59 | ||
60 | define xgettype | |
0e73312b RS |
61 | set $bugfix = $arg0 |
62 | set $type = gdb_use_union ? $bugfix.s.type : (enum Lisp_Type) (gdb_use_lsb ? $bugfix & $tagmask : $bugfix >> gdb_valbits) | |
6b61353c | 63 | end |
b74f15c6 | 64 | |
a6ffc6a2 | 65 | # Set up something to print out s-expressions. |
4fccedb5 EZ |
66 | # We save and restore print_output_debug_flag to prevent the w32 port |
67 | # from calling OutputDebugString, which causes GDB to display each | |
68 | # character twice (yuk!). | |
a6ffc6a2 | 69 | define pr |
4fccedb5 EZ |
70 | set $output_debug = print_output_debug_flag |
71 | set print_output_debug_flag = 0 | |
6b61353c | 72 | set debug_print ($) |
4fccedb5 | 73 | set print_output_debug_flag = $output_debug |
a6ffc6a2 | 74 | end |
a6ffc6a2 JB |
75 | document pr |
76 | Print the emacs s-expression which is $. | |
77 | Works only when an inferior emacs is executing. | |
78 | end | |
79 | ||
6c5d0c52 KS |
80 | # Print out s-expressions |
81 | define pp | |
82 | set $tmp = $arg0 | |
4fccedb5 EZ |
83 | set $output_debug = print_output_debug_flag |
84 | set print_output_debug_flag = 0 | |
1609a963 | 85 | set safe_debug_print ($tmp) |
4fccedb5 | 86 | set print_output_debug_flag = $output_debug |
6c5d0c52 KS |
87 | end |
88 | document pp | |
89 | Print the argument as an emacs s-expression | |
90 | Works only when an inferior emacs is executing. | |
91 | end | |
92 | ||
8a386286 NR |
93 | # Print out s-expressions from tool bar |
94 | define pp1 | |
95 | set $tmp = $arg0 | |
4fccedb5 EZ |
96 | set $output_debug = print_output_debug_flag |
97 | set print_output_debug_flag = 0 | |
1609a963 | 98 | set safe_debug_print ($tmp) |
4fccedb5 | 99 | set print_output_debug_flag = $output_debug |
8a386286 NR |
100 | end |
101 | document pp1 | |
5cd35d2c | 102 | Print the argument as an emacs s-expression. |
8a386286 NR |
103 | Works only when an inferior emacs is executing. |
104 | For use on tool bar when debugging in Emacs | |
105 | where the variable name would not otherwise | |
106 | be recorded in the GUD buffer. | |
107 | end | |
108 | ||
1609a963 KS |
109 | # Print value of lisp variable |
110 | define pv | |
111 | set $tmp = "$arg0" | |
4fccedb5 EZ |
112 | set $output_debug = print_output_debug_flag |
113 | set print_output_debug_flag = 0 | |
1609a963 | 114 | set safe_debug_print ( find_symbol_value (intern ($tmp))) |
4fccedb5 | 115 | set print_output_debug_flag = $output_debug |
1609a963 KS |
116 | end |
117 | document pv | |
118 | Print the value of the lisp variable given as argument. | |
119 | Works only when an inferior emacs is executing. | |
120 | end | |
121 | ||
122 | # Print value of lisp variable | |
123 | define pv1 | |
124 | set $tmp = "$arg0" | |
4fccedb5 EZ |
125 | set $output_debug = print_output_debug_flag |
126 | set print_output_debug_flag = 0 | |
1609a963 | 127 | set safe_debug_print (find_symbol_value (intern ($tmp))) |
4fccedb5 | 128 | set print_output_debug_flag = $output_debug |
1609a963 KS |
129 | end |
130 | document pv1 | |
131 | Print the value of the lisp variable given as argument. | |
132 | Works only when an inferior emacs is executing. | |
5cd35d2c NR |
133 | For use when debugging in Emacs where the variable |
134 | name would not otherwise be recorded in the GUD buffer. | |
1609a963 KS |
135 | end |
136 | ||
decf4020 KS |
137 | # Print out current buffer point and boundaries |
138 | define ppt | |
139 | set $b = current_buffer | |
140 | set $t = $b->text | |
141 | printf "BUF PT: %d", $b->pt | |
142 | if ($b->pt != $b->pt_byte) | |
143 | printf "[%d]", $b->pt_byte | |
144 | end | |
145 | printf " of 1..%d", $t->z | |
146 | if ($t->z != $t->z_byte) | |
147 | printf "[%d]", $t->z_byte | |
148 | end | |
149 | if ($b->begv != 1 || $b->zv != $t->z) | |
150 | printf " NARROW=%d..%d", $b->begv, $b->zv | |
151 | if ($b->begv != $b->begv_byte || $b->zv != $b->zv_byte) | |
152 | printf " [%d..%d]", $b->begv_byte, $b->zv_byte | |
153 | end | |
154 | end | |
155 | printf " GAP: %d", $t->gpt | |
156 | if ($t->gpt != $t->gpt_byte) | |
157 | printf "[%d]", $t->gpt_byte | |
158 | end | |
159 | printf " SZ=%d\n", $t->gap_size | |
160 | end | |
161 | document ppt | |
2d5ed88d EZ |
162 | Print current buffer's point and boundaries. |
163 | Prints values of point, beg, end, narrow, and gap for current buffer. | |
decf4020 KS |
164 | end |
165 | ||
afca296c KS |
166 | # Print out iterator given as first arg |
167 | define pitx | |
168 | set $it = $arg0 | |
169 | printf "cur=%d", $it->current.pos.charpos | |
170 | if ($it->current.pos.charpos != $it->current.pos.bytepos) | |
171 | printf "[%d]", $it->current.pos.bytepos | |
172 | end | |
82d59cb0 KS |
173 | printf " pos=%d", $it->position.charpos |
174 | if ($it->position.charpos != $it->position.bytepos) | |
175 | printf "[%d]", $it->position.bytepos | |
176 | end | |
afca296c KS |
177 | printf " start=%d", $it->start.pos.charpos |
178 | if ($it->start.pos.charpos != $it->start.pos.bytepos) | |
179 | printf "[%d]", $it->start.pos.bytepos | |
180 | end | |
2fde1500 KS |
181 | printf " end=%d", $it->end_charpos |
182 | printf " stop=%d", $it->stop_charpos | |
183 | printf " face=%d", $it->face_id | |
184 | if ($it->multibyte_p) | |
185 | printf " MB" | |
186 | end | |
187 | if ($it->header_line_p) | |
188 | printf " HL" | |
189 | end | |
190 | if ($it->n_overlay_strings > 0) | |
338fa84a | 191 | printf " nov=%d", $it->n_overlay_strings |
2fde1500 KS |
192 | end |
193 | if ($it->sp != 0) | |
194 | printf " sp=%d", $it->sp | |
195 | end | |
afca296c KS |
196 | if ($it->what == IT_CHARACTER) |
197 | if ($it->len == 1 && $it->c >= ' ' && it->c < 255) | |
501b66fa | 198 | printf " ch='%c'", $it->c |
afca296c | 199 | else |
501b66fa | 200 | printf " ch=[%d,%d]", $it->c, $it->len |
2fde1500 KS |
201 | end |
202 | else | |
1e99743b KS |
203 | printf " " |
204 | output $it->what | |
afca296c | 205 | end |
2fde1500 KS |
206 | if ($it->method != GET_FROM_BUFFER) |
207 | printf " next=" | |
208 | output $it->method | |
501b66fa KS |
209 | if ($it->method == GET_FROM_STRING) |
210 | printf "[%d]", $it->current.string_pos.charpos | |
211 | end | |
1e99743b KS |
212 | if ($it->method == GET_FROM_IMAGE) |
213 | printf "[%d]", $it->image_id | |
214 | end | |
215 | if ($it->method == GET_FROM_COMPOSITION) | |
216 | printf "[%d,%d,%d]", $it->cmp_id, $it->len, $it->cmp_len | |
217 | end | |
2fde1500 | 218 | end |
afca296c | 219 | printf "\n" |
2fde1500 KS |
220 | if ($it->region_beg_charpos >= 0) |
221 | printf "reg=%d-%d ", $it->region_beg_charpos, $it->region_end_charpos | |
222 | end | |
afca296c KS |
223 | printf "vpos=%d hpos=%d", $it->vpos, $it->hpos, |
224 | printf " y=%d lvy=%d", $it->current_y, $it->last_visible_y | |
2fde1500 | 225 | printf " x=%d vx=%d-%d", $it->current_x, $it->first_visible_x, $it->last_visible_x |
28c1e1ca | 226 | printf " w=%d", $it->pixel_width |
afca296c KS |
227 | printf " a+d=%d+%d=%d", $it->ascent, $it->descent, $it->ascent+$it->descent |
228 | printf " max=%d+%d=%d", $it->max_ascent, $it->max_descent, $it->max_ascent+$it->max_descent | |
229 | printf "\n" | |
0058964e | 230 | set $i = 0 |
82d59cb0 | 231 | while ($i < $it->sp && $i < 4) |
0058964e KS |
232 | set $e = $it->stack[$i] |
233 | printf "stack[%d]: ", $i | |
234 | output $e->method | |
235 | printf "[%d]", $e->position.charpos | |
236 | printf "\n" | |
237 | set $i = $i + 1 | |
238 | end | |
afca296c KS |
239 | end |
240 | document pitx | |
241 | Pretty print a display iterator. | |
242 | Take one arg, an iterator object or pointer. | |
243 | end | |
244 | ||
245 | define pit | |
246 | pitx it | |
247 | end | |
248 | document pit | |
249 | Pretty print the display iterator it. | |
250 | end | |
251 | ||
252 | define prowx | |
253 | set $row = $arg0 | |
254 | printf "y=%d x=%d pwid=%d", $row->y, $row->x, $row->pixel_width | |
255 | printf " a+d=%d+%d=%d", $row->ascent, $row->height-$row->ascent, $row->height | |
256 | printf " phys=%d+%d=%d", $row->phys_ascent, $row->phys_height-$row->phys_ascent, $row->phys_height | |
257 | printf " vis=%d", $row->visible_height | |
258 | printf " L=%d T=%d R=%d", $row->used[0], $row->used[1], $row->used[2] | |
259 | printf "\n" | |
260 | printf "start=%d end=%d", $row->start.pos.charpos, $row->end.pos.charpos | |
261 | if ($row->enabled_p) | |
262 | printf " ENA" | |
263 | end | |
264 | if ($row->displays_text_p) | |
265 | printf " DISP" | |
266 | end | |
267 | if ($row->mode_line_p) | |
268 | printf " MODEL" | |
269 | end | |
270 | if ($row->continued_p) | |
271 | printf " CONT" | |
272 | end | |
273 | if ($row-> truncated_on_left_p) | |
274 | printf " TRUNC:L" | |
275 | end | |
276 | if ($row-> truncated_on_right_p) | |
277 | printf " TRUNC:R" | |
278 | end | |
279 | if ($row->starts_in_middle_of_char_p) | |
280 | printf " STARTMID" | |
281 | end | |
282 | if ($row->ends_in_middle_of_char_p) | |
283 | printf " ENDMID" | |
284 | end | |
285 | if ($row->ends_in_newline_from_string_p) | |
286 | printf " ENDNLFS" | |
287 | end | |
288 | if ($row->ends_at_zv_p) | |
289 | printf " ENDZV" | |
290 | end | |
291 | if ($row->overlapped_p) | |
292 | printf " OLAPD" | |
293 | end | |
294 | if ($row->overlapping_p) | |
295 | printf " OLAPNG" | |
296 | end | |
297 | printf "\n" | |
298 | end | |
299 | document prowx | |
300 | Pretty print information about glyph_row. | |
301 | Takes one argument, a row object or pointer. | |
302 | end | |
303 | ||
304 | define prow | |
305 | prowx row | |
306 | end | |
307 | document prow | |
308 | Pretty print information about glyph_row in row. | |
309 | end | |
310 | ||
311 | ||
312 | define pcursorx | |
313 | set $cp = $arg0 | |
314 | printf "y=%d x=%d vpos=%d hpos=%d", $cp->y, $cp->x, $cp->vpos, $cp->hpos | |
315 | end | |
316 | document pcursorx | |
89955f2e | 317 | Pretty print a window cursor. |
afca296c KS |
318 | end |
319 | ||
320 | define pcursor | |
321 | printf "output: " | |
322 | pcursorx output_cursor | |
323 | printf "\n" | |
324 | end | |
325 | document pcursor | |
89955f2e | 326 | Pretty print the output_cursor. |
afca296c KS |
327 | end |
328 | ||
329 | define pwinx | |
330 | set $w = $arg0 | |
331 | xgetint $w->sequence_number | |
332 | if ($w->mini_p != Qnil) | |
333 | printf "Mini " | |
334 | end | |
335 | printf "Window %d ", $int | |
336 | xgetptr $w->buffer | |
337 | set $tem = (struct buffer *) $ptr | |
338 | xgetptr $tem->name | |
339 | printf "%s", ((struct Lisp_String *) $ptr)->data | |
340 | printf "\n" | |
341 | xgetptr $w->start | |
342 | set $tem = (struct Lisp_Marker *) $ptr | |
343 | printf "start=%d end:", $tem->charpos | |
344 | if ($w->window_end_valid != Qnil) | |
345 | xgetint $w->window_end_pos | |
346 | printf "pos=%d", $int | |
347 | xgetint $w->window_end_vpos | |
348 | printf " vpos=%d", $int | |
349 | else | |
350 | printf "invalid" | |
351 | end | |
352 | printf " vscroll=%d", $w->vscroll | |
353 | if ($w->force_start != Qnil) | |
354 | printf " FORCE_START" | |
355 | end | |
356 | if ($w->must_be_updated_p) | |
357 | printf " MUST_UPD" | |
358 | end | |
359 | printf "\n" | |
360 | printf "cursor: " | |
361 | pcursorx $w->cursor | |
362 | printf " phys: " | |
363 | pcursorx $w->phys_cursor | |
364 | if ($w->phys_cursor_on_p) | |
365 | printf " ON" | |
366 | else | |
367 | printf " OFF" | |
368 | end | |
369 | printf " blk=" | |
370 | if ($w->last_cursor_off_p != $w->cursor_off_p) | |
371 | if ($w->last_cursor_off_p) | |
372 | printf "ON->" | |
373 | else | |
374 | printf "OFF->" | |
375 | end | |
376 | end | |
377 | if ($w->cursor_off_p) | |
378 | printf "ON" | |
379 | else | |
380 | printf "OFF" | |
381 | end | |
382 | printf "\n" | |
383 | end | |
384 | document pwinx | |
385 | Pretty print a window structure. | |
89955f2e | 386 | Takes one argument, a pointer to a window structure. |
afca296c KS |
387 | end |
388 | ||
389 | define pwin | |
390 | pwinx w | |
391 | end | |
392 | document pwin | |
393 | Pretty print window structure w. | |
394 | end | |
395 | ||
1e99743b KS |
396 | define pgx |
397 | set $g = $arg0 | |
398 | if ($g->type == CHAR_GLYPH) | |
399 | if ($g->u.ch >= ' ' && $g->u.ch < 127) | |
400 | printf "CHAR[%c]", $g->u.ch | |
401 | else | |
402 | printf "CHAR[0x%x]", $g->u.ch | |
403 | end | |
404 | end | |
405 | if ($g->type == COMPOSITE_GLYPH) | |
406 | printf "COMP[%d]", $g->u.cmp_id | |
407 | end | |
408 | if ($g->type == IMAGE_GLYPH) | |
409 | printf "IMAGE[%d]", $g->u.img_id | |
410 | end | |
411 | if ($g->type == STRETCH_GLYPH) | |
412 | printf "STRETCH[%d+%d]", $g->u.stretch.height, $g->u.stretch.ascent | |
413 | end | |
414 | xgettype ($g->object) | |
415 | if ($type == Lisp_String) | |
416 | printf " str=%x[%d]", $g->object, $g->charpos | |
417 | else | |
418 | printf " pos=%d", $g->charpos | |
419 | end | |
420 | printf " w=%d a+d=%d+%d", $g->pixel_width, $g->ascent, $g->descent | |
421 | if ($g->face_id != DEFAULT_FACE_ID) | |
422 | printf " face=%d", $g->face_id | |
423 | end | |
424 | if ($g->voffset) | |
425 | printf " vof=%d", $g->voffset | |
426 | end | |
427 | if ($g->multibyte_p) | |
428 | printf " MB" | |
429 | end | |
430 | if ($g->padding_p) | |
431 | printf " PAD" | |
432 | end | |
433 | if ($g->glyph_not_available_p) | |
434 | printf " N/A" | |
435 | end | |
436 | if ($g->overlaps_vertically_p) | |
437 | printf " OVL" | |
438 | end | |
439 | if ($g->left_box_line_p) | |
440 | printf " [" | |
441 | end | |
442 | if ($g->right_box_line_p) | |
443 | printf " ]" | |
444 | end | |
445 | if ($g->slice.x || $g->slice.y || $g->slice.width || $g->slice.height) | |
446 | printf " slice=%d,%d,%d,%d" ,$g->slice.x, $g->slice.y, $g->slice.width, $g->slice.height | |
447 | end | |
448 | printf "\n" | |
449 | end | |
450 | document pgx | |
451 | Pretty print a glyph structure. | |
89955f2e | 452 | Takes one argument, a pointer to a glyph structure. |
1e99743b KS |
453 | end |
454 | ||
455 | define pg | |
456 | set $pgidx = 0 | |
457 | pgx glyph | |
458 | end | |
459 | document pg | |
460 | Pretty print glyph structure glyph. | |
461 | end | |
462 | ||
463 | define pgi | |
464 | set $pgidx = $arg0 | |
465 | pgx (&glyph[$pgidx]) | |
466 | end | |
467 | document pgi | |
468 | Pretty print glyph structure glyph[I]. | |
469 | Takes one argument, a integer I. | |
470 | end | |
471 | ||
472 | define pgn | |
473 | set $pgidx = $pgidx + 1 | |
474 | pgx (&glyph[$pgidx]) | |
475 | end | |
476 | document pgn | |
477 | Pretty print next glyph structure. | |
478 | end | |
479 | ||
480 | define pgrowx | |
481 | set $row = $arg0 | |
482 | set $area = 0 | |
483 | set $xofs = $row->x | |
484 | while ($area < 3) | |
485 | set $used = $row->used[$area] | |
486 | if ($used > 0) | |
487 | set $gl0 = $row->glyphs[$area] | |
488 | set $pgidx = 0 | |
489 | printf "%s: %d glyphs\n", ($area == 0 ? "LEFT" : $area == 2 ? "RIGHT" : "TEXT"), $used | |
490 | while ($pgidx < $used) | |
491 | printf "%3d %4d: ", $pgidx, $xofs | |
492 | pgx $gl0[$pgidx] | |
493 | set $xofs = $xofs + $gl0[$pgidx]->pixel_width | |
494 | set $pgidx = $pgidx + 1 | |
495 | end | |
496 | end | |
497 | set $area = $area + 1 | |
498 | end | |
499 | end | |
500 | document pgrowx | |
501 | Pretty print all glyphs in a row structure. | |
502 | Takes one argument, a pointer to a row structure. | |
503 | end | |
504 | ||
505 | define pgrow | |
506 | pgrowx row | |
507 | end | |
508 | document pgrow | |
509 | Pretty print all glyphs in row structure row. | |
510 | end | |
afca296c | 511 | |
a6ffc6a2 | 512 | define xtype |
6b61353c KH |
513 | xgettype $ |
514 | output $type | |
515 | echo \n | |
516 | if $type == Lisp_Misc | |
517 | xmisctype | |
518 | else | |
519 | if $type == Lisp_Vectorlike | |
520 | xvectype | |
521 | end | |
522 | end | |
a6ffc6a2 | 523 | end |
e065a56e | 524 | document xtype |
ba1e23bf | 525 | Print the type of $, assuming it is an Emacs Lisp value. |
3fe8bda5 | 526 | If the first type printed is Lisp_Vector or Lisp_Misc, |
6b61353c | 527 | a second line gives the more precise type. |
3fe8bda5 RS |
528 | end |
529 | ||
530 | define xvectype | |
6b61353c KH |
531 | xgetptr $ |
532 | set $size = ((struct Lisp_Vector *) $ptr)->size | |
fc80da24 | 533 | output ($size & PVEC_FLAG) ? (enum pvec_type) ($size & PVEC_TYPE_MASK) : $size & ~gdb_array_mark_flag |
6b61353c | 534 | echo \n |
3fe8bda5 RS |
535 | end |
536 | document xvectype | |
89955f2e NR |
537 | Print the size or vector subtype of $. |
538 | This command assumes that $ is a vector or pseudovector. | |
3fe8bda5 RS |
539 | end |
540 | ||
541 | define xmisctype | |
6b61353c KH |
542 | xgetptr $ |
543 | output (enum Lisp_Misc_Type) (((struct Lisp_Free *) $ptr)->type) | |
544 | echo \n | |
3fe8bda5 RS |
545 | end |
546 | document xmisctype | |
2d5ed88d | 547 | Assume that $ is some misc type and print its specific type. |
e065a56e | 548 | end |
a6ffc6a2 JB |
549 | |
550 | define xint | |
6b61353c KH |
551 | xgetint $ |
552 | print $int | |
a6ffc6a2 | 553 | end |
e065a56e | 554 | document xint |
2d5ed88d | 555 | Print $ as an Emacs Lisp integer. This gets the sign right. |
e065a56e | 556 | end |
a6ffc6a2 JB |
557 | |
558 | define xptr | |
6b61353c KH |
559 | xgetptr $ |
560 | print (void *) $ptr | |
a6ffc6a2 | 561 | end |
e065a56e | 562 | document xptr |
2d5ed88d | 563 | Print the pointer portion of an Emacs Lisp value in $. |
e065a56e | 564 | end |
a6ffc6a2 | 565 | |
a6ffc6a2 | 566 | define xmarker |
6b61353c KH |
567 | xgetptr $ |
568 | print (struct Lisp_Marker *) $ptr | |
a6ffc6a2 | 569 | end |
e065a56e | 570 | document xmarker |
2d5ed88d EZ |
571 | Print $ as a marker pointer. |
572 | This command assumes that $ is an Emacs Lisp marker value. | |
e065a56e | 573 | end |
a6ffc6a2 | 574 | |
a6a3acf0 | 575 | define xoverlay |
6b61353c KH |
576 | xgetptr $ |
577 | print (struct Lisp_Overlay *) $ptr | |
a6a3acf0 KH |
578 | end |
579 | document xoverlay | |
89955f2e NR |
580 | Print $ as a overlay pointer. |
581 | This command assumes that $ is an Emacs Lisp overlay value. | |
a6a3acf0 KH |
582 | end |
583 | ||
584 | define xmiscfree | |
6b61353c KH |
585 | xgetptr $ |
586 | print (struct Lisp_Free *) $ptr | |
a6a3acf0 KH |
587 | end |
588 | document xmiscfree | |
89955f2e NR |
589 | Print $ as a misc free-cell pointer. |
590 | This command assumes that $ is an Emacs Lisp Misc value. | |
a6a3acf0 KH |
591 | end |
592 | ||
593 | define xintfwd | |
6b61353c KH |
594 | xgetptr $ |
595 | print (struct Lisp_Intfwd *) $ptr | |
a6a3acf0 KH |
596 | end |
597 | document xintfwd | |
89955f2e NR |
598 | Print $ as an integer forwarding pointer. |
599 | This command assumes that $ is an Emacs Lisp Misc value. | |
a6a3acf0 KH |
600 | end |
601 | ||
602 | define xboolfwd | |
6b61353c KH |
603 | xgetptr $ |
604 | print (struct Lisp_Boolfwd *) $ptr | |
a6a3acf0 KH |
605 | end |
606 | document xboolfwd | |
89955f2e NR |
607 | Print $ as a boolean forwarding pointer. |
608 | This command assumes that $ is an Emacs Lisp Misc value. | |
a6a3acf0 KH |
609 | end |
610 | ||
611 | define xobjfwd | |
6b61353c KH |
612 | xgetptr $ |
613 | print (struct Lisp_Objfwd *) $ptr | |
a6a3acf0 KH |
614 | end |
615 | document xobjfwd | |
89955f2e NR |
616 | Print $ as an object forwarding pointer. |
617 | This command assumes that $ is an Emacs Lisp Misc value. | |
a6a3acf0 KH |
618 | end |
619 | ||
029c56f6 | 620 | define xbufobjfwd |
6b61353c KH |
621 | xgetptr $ |
622 | print (struct Lisp_Buffer_Objfwd *) $ptr | |
a6a3acf0 | 623 | end |
029c56f6 | 624 | document xbufobjfwd |
89955f2e NR |
625 | Print $ as a buffer-local object forwarding pointer. |
626 | This command assumes that $ is an Emacs Lisp Misc value. | |
a6a3acf0 KH |
627 | end |
628 | ||
a0371857 | 629 | define xkbobjfwd |
6b61353c KH |
630 | xgetptr $ |
631 | print (struct Lisp_Kboard_Objfwd *) $ptr | |
cd39e946 | 632 | end |
a0371857 | 633 | document xkbobjfwd |
89955f2e NR |
634 | Print $ as a kboard-local object forwarding pointer. |
635 | This command assumes that $ is an Emacs Lisp Misc value. | |
cd39e946 KH |
636 | end |
637 | ||
029c56f6 | 638 | define xbuflocal |
6b61353c KH |
639 | xgetptr $ |
640 | print (struct Lisp_Buffer_Local_Value *) $ptr | |
a6a3acf0 | 641 | end |
029c56f6 | 642 | document xbuflocal |
89955f2e NR |
643 | Print $ as a buffer-local-value pointer. |
644 | This command assumes that $ is an Emacs Lisp Misc value. | |
a6a3acf0 KH |
645 | end |
646 | ||
a6ffc6a2 | 647 | define xsymbol |
cfcde636 KS |
648 | set $sym = $ |
649 | xgetptr $sym | |
6b61353c | 650 | print (struct Lisp_Symbol *) $ptr |
cfcde636 | 651 | xprintsym $sym |
6b61353c | 652 | echo \n |
a6ffc6a2 | 653 | end |
e065a56e JB |
654 | document xsymbol |
655 | Print the name and address of the symbol $. | |
ba1e23bf | 656 | This command assumes that $ is an Emacs Lisp symbol value. |
e065a56e | 657 | end |
a6ffc6a2 JB |
658 | |
659 | define xstring | |
6b61353c KH |
660 | xgetptr $ |
661 | print (struct Lisp_String *) $ptr | |
0001e968 | 662 | xprintstr $ |
6b61353c | 663 | echo \n |
a6ffc6a2 | 664 | end |
a6ffc6a2 | 665 | document xstring |
e065a56e | 666 | Print the contents and address of the string $. |
ba1e23bf | 667 | This command assumes that $ is an Emacs Lisp string value. |
a6ffc6a2 JB |
668 | end |
669 | ||
670 | define xvector | |
6b61353c KH |
671 | xgetptr $ |
672 | print (struct Lisp_Vector *) $ptr | |
fc80da24 | 673 | output ($->size > 50) ? 0 : ($->contents[0])@($->size & ~gdb_array_mark_flag) |
ef15f270 | 674 | echo \n |
a6ffc6a2 | 675 | end |
a6ffc6a2 | 676 | document xvector |
e065a56e | 677 | Print the contents and address of the vector $. |
ba1e23bf | 678 | This command assumes that $ is an Emacs Lisp vector value. |
a6ffc6a2 JB |
679 | end |
680 | ||
14a8902a | 681 | define xprocess |
6b61353c KH |
682 | xgetptr $ |
683 | print (struct Lisp_Process *) $ptr | |
684 | output *$ | |
685 | echo \n | |
14a8902a RS |
686 | end |
687 | document xprocess | |
89955f2e NR |
688 | Print the address of the struct Lisp_process to which $ points. |
689 | This command assumes that $ is a Lisp_Object. | |
14a8902a RS |
690 | end |
691 | ||
ec558adc | 692 | define xframe |
6b61353c KH |
693 | xgetptr $ |
694 | print (struct frame *) $ptr | |
28c1e1ca KS |
695 | xgetptr $->name |
696 | set $ptr = (struct Lisp_String *) $ptr | |
697 | xprintstr $ptr | |
698 | echo \n | |
a6ffc6a2 | 699 | end |
ec558adc | 700 | document xframe |
2d5ed88d EZ |
701 | Print $ as a frame pointer. |
702 | This command assumes $ is an Emacs Lisp frame value. | |
e065a56e | 703 | end |
a6ffc6a2 | 704 | |
14a8902a | 705 | define xcompiled |
6b61353c KH |
706 | xgetptr $ |
707 | print (struct Lisp_Vector *) $ptr | |
708 | output ($->contents[0])@($->size & 0xff) | |
14a8902a RS |
709 | end |
710 | document xcompiled | |
89955f2e NR |
711 | Print $ as a compiled function pointer. |
712 | This command assumes that $ is an Emacs Lisp compiled value. | |
14a8902a RS |
713 | end |
714 | ||
715 | define xwindow | |
6b61353c KH |
716 | xgetptr $ |
717 | print (struct window *) $ptr | |
25d34643 RS |
718 | set $window = (struct window *) $ptr |
719 | xgetint $window->total_cols | |
720 | set $width=$int | |
721 | xgetint $window->total_lines | |
722 | set $height=$int | |
723 | xgetint $window->left_col | |
724 | set $left=$int | |
725 | xgetint $window->top_line | |
726 | set $top=$int | |
727 | printf "%dx%d+%d+%d\n", $width, $height, $left, $top | |
14a8902a RS |
728 | end |
729 | document xwindow | |
730 | Print $ as a window pointer, assuming it is an Emacs Lisp window value. | |
731 | Print the window's position as "WIDTHxHEIGHT+LEFT+TOP". | |
732 | end | |
733 | ||
029c56f6 | 734 | define xwinconfig |
6b61353c KH |
735 | xgetptr $ |
736 | print (struct save_window_data *) $ptr | |
a6a3acf0 | 737 | end |
029c56f6 | 738 | document xwinconfig |
89955f2e NR |
739 | Print $ as a window configuration pointer. |
740 | This command assumes that $ is an Emacs Lisp window configuration value. | |
a6a3acf0 KH |
741 | end |
742 | ||
14a8902a | 743 | define xsubr |
6b61353c KH |
744 | xgetptr $ |
745 | print (struct Lisp_Subr *) $ptr | |
746 | output *$ | |
747 | echo \n | |
a6a3acf0 | 748 | end |
14a8902a RS |
749 | document xsubr |
750 | Print the address of the subr which the Lisp_Object $ points to. | |
751 | end | |
752 | ||
753 | define xchartable | |
6b61353c KH |
754 | xgetptr $ |
755 | print (struct Lisp_Char_Table *) $ptr | |
756 | printf "Purpose: " | |
757 | xprintsym $->purpose | |
758 | printf " %d extra slots", ($->size & 0x1ff) - 68 | |
759 | echo \n | |
14a8902a RS |
760 | end |
761 | document xchartable | |
762 | Print the address of the char-table $, and its purpose. | |
763 | This command assumes that $ is an Emacs Lisp char-table value. | |
764 | end | |
765 | ||
766 | define xboolvector | |
6b61353c KH |
767 | xgetptr $ |
768 | print (struct Lisp_Bool_Vector *) $ptr | |
fc80da24 | 769 | output ($->size > 256) ? 0 : ($->data[0])@((($->size & ~gdb_array_mark_flag) + 7)/ 8) |
6b61353c | 770 | echo \n |
14a8902a RS |
771 | end |
772 | document xboolvector | |
773 | Print the contents and address of the bool-vector $. | |
774 | This command assumes that $ is an Emacs Lisp bool-vector value. | |
775 | end | |
776 | ||
777 | define xbuffer | |
6b61353c KH |
778 | xgetptr $ |
779 | print (struct buffer *) $ptr | |
780 | xgetptr $->name | |
781 | output ((struct Lisp_String *) $ptr)->data | |
782 | echo \n | |
14a8902a RS |
783 | end |
784 | document xbuffer | |
2d5ed88d EZ |
785 | Set $ as a buffer pointer and the name of the buffer. |
786 | This command assumes $ is an Emacs Lisp buffer value. | |
a6a3acf0 KH |
787 | end |
788 | ||
3266f62b | 789 | define xhashtable |
6b61353c KH |
790 | xgetptr $ |
791 | print (struct Lisp_Hash_Table *) $ptr | |
3266f62b GM |
792 | end |
793 | document xhashtable | |
89955f2e NR |
794 | Set $ as a hash table pointer. |
795 | This command assumes that $ is an Emacs Lisp hash table value. | |
3266f62b GM |
796 | end |
797 | ||
a6ffc6a2 | 798 | define xcons |
6b61353c KH |
799 | xgetptr $ |
800 | print (struct Lisp_Cons *) $ptr | |
801 | output/x *$ | |
802 | echo \n | |
a6ffc6a2 | 803 | end |
e065a56e | 804 | document xcons |
2d5ed88d | 805 | Print the contents of $ as an Emacs Lisp cons. |
e065a56e | 806 | end |
a6ffc6a2 | 807 | |
6f493884 | 808 | define nextcons |
b4483658 | 809 | p $.u.cdr |
6b61353c | 810 | xcons |
6f493884 RS |
811 | end |
812 | document nextcons | |
813 | Print the contents of the next cell in a list. | |
89955f2e | 814 | This command assumes that the last thing you printed was a cons cell contents |
6f493884 RS |
815 | (type struct Lisp_Cons) or a pointer to one. |
816 | end | |
a6ffc6a2 | 817 | define xcar |
6b61353c KH |
818 | xgetptr $ |
819 | xgettype $ | |
820 | print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->car : 0) | |
a6ffc6a2 | 821 | end |
e065a56e | 822 | document xcar |
2d5ed88d | 823 | Assume that $ is an Emacs Lisp pair and print its car. |
e065a56e | 824 | end |
a6ffc6a2 JB |
825 | |
826 | define xcdr | |
6b61353c KH |
827 | xgetptr $ |
828 | xgettype $ | |
b4483658 | 829 | print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->u.cdr : 0) |
a6ffc6a2 | 830 | end |
e065a56e | 831 | document xcdr |
2d5ed88d | 832 | Assume that $ is an Emacs Lisp pair and print its cdr. |
e065a56e | 833 | end |
a6ffc6a2 | 834 | |
28c1e1ca KS |
835 | define xlist |
836 | xgetptr $ | |
837 | set $cons = (struct Lisp_Cons *) $ptr | |
838 | xgetptr Qnil | |
839 | set $nil = $ptr | |
840 | set $i = 0 | |
841 | while $cons != $nil && $i < 10 | |
842 | p/x $cons->car | |
843 | xpr | |
844 | xgetptr $cons->u.cdr | |
845 | set $cons = (struct Lisp_Cons *) $ptr | |
846 | set $i = $i + 1 | |
847 | printf "---\n" | |
848 | end | |
849 | if $cons == $nil | |
850 | printf "nil\n" | |
851 | else | |
852 | printf "...\n" | |
853 | p $ptr | |
854 | end | |
855 | end | |
856 | document xlist | |
857 | Print $ assuming it is a list. | |
858 | end | |
859 | ||
df86e57e | 860 | define xfloat |
6b61353c | 861 | xgetptr $ |
b4483658 | 862 | print ((struct Lisp_Float *) $ptr)->u.data |
df86e57e JB |
863 | end |
864 | document xfloat | |
865 | Print $ assuming it is a lisp floating-point number. | |
866 | end | |
867 | ||
b2367490 | 868 | define xscrollbar |
6b61353c KH |
869 | xgetptr $ |
870 | print (struct scrollbar *) $ptr | |
b2367490 JB |
871 | output *$ |
872 | echo \n | |
873 | end | |
dec5f4e3 | 874 | document xscrollbar |
b2367490 JB |
875 | Print $ as a scrollbar pointer. |
876 | end | |
877 | ||
28c1e1ca KS |
878 | define xpr |
879 | xtype | |
880 | if $type == Lisp_Int | |
881 | xint | |
882 | end | |
883 | if $type == Lisp_Symbol | |
884 | xsymbol | |
885 | end | |
886 | if $type == Lisp_String | |
887 | xstring | |
888 | end | |
889 | if $type == Lisp_Cons | |
890 | xcons | |
891 | end | |
892 | if $type == Lisp_Float | |
893 | xfloat | |
894 | end | |
895 | if $type == Lisp_Misc | |
896 | set $misc = (enum Lisp_Misc_Type) (((struct Lisp_Free *) $ptr)->type) | |
897 | if $misc == Lisp_Misc_Free | |
898 | xmiscfree | |
899 | end | |
900 | if $misc == Lisp_Misc_Boolfwd | |
901 | xboolfwd | |
902 | end | |
903 | if $misc == Lisp_Misc_Marker | |
904 | xmarker | |
905 | end | |
906 | if $misc == Lisp_Misc_Intfwd | |
907 | xintfwd | |
908 | end | |
909 | if $misc == Lisp_Misc_Boolfwd | |
910 | xboolfwd | |
911 | end | |
912 | if $misc == Lisp_Misc_Objfwd | |
913 | xobjfwd | |
914 | end | |
915 | if $misc == Lisp_Misc_Buffer_Objfwd | |
916 | xbufobjfwd | |
917 | end | |
918 | if $misc == Lisp_Misc_Buffer_Local_Value | |
919 | xbuflocal | |
920 | end | |
921 | # if $misc == Lisp_Misc_Some_Buffer_Local_Value | |
922 | # xvalue | |
923 | # end | |
924 | if $misc == Lisp_Misc_Overlay | |
925 | xoverlay | |
926 | end | |
927 | if $misc == Lisp_Misc_Kboard_Objfwd | |
928 | xkbobjfwd | |
929 | end | |
930 | # if $misc == Lisp_Misc_Save_Value | |
931 | # xsavevalue | |
932 | # end | |
933 | end | |
934 | if $type == Lisp_Vectorlike | |
935 | set $size = ((struct Lisp_Vector *) $ptr)->size | |
936 | if ($size & PVEC_FLAG) | |
937 | set $vec = (enum pvec_type) ($size & PVEC_TYPE_MASK) | |
938 | if $vec == PVEC_NORMAL_VECTOR | |
939 | xvector | |
940 | end | |
941 | if $vec == PVEC_PROCESS | |
942 | xprocess | |
943 | end | |
944 | if $vec == PVEC_FRAME | |
945 | xframe | |
946 | end | |
947 | if $vec == PVEC_COMPILED | |
948 | xcompiled | |
949 | end | |
950 | if $vec == PVEC_WINDOW | |
951 | xwindow | |
952 | end | |
953 | if $vec == PVEC_WINDOW_CONFIGURATION | |
954 | xwinconfig | |
955 | end | |
956 | if $vec == PVEC_SUBR | |
957 | xsubr | |
958 | end | |
959 | if $vec == PVEC_CHAR_TABLE | |
960 | xchartable | |
961 | end | |
962 | if $vec == PVEC_BOOL_VECTOR | |
963 | xboolvector | |
964 | end | |
965 | if $vec == PVEC_BUFFER | |
966 | xbuffer | |
967 | end | |
968 | if $vec == PVEC_HASH_TABLE | |
969 | xhashtable | |
970 | end | |
971 | else | |
972 | xvector | |
973 | end | |
974 | end | |
975 | end | |
976 | document xpr | |
977 | Print $ as a lisp object of any type. | |
978 | end | |
979 | ||
0001e968 | 980 | define xprintstr |
d3332249 | 981 | set $data = (char *) $arg0->data |
0001e968 SM |
982 | output ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~gdb_array_mark_flag : $arg0->size_byte) |
983 | end | |
984 | ||
24b4d1bc | 985 | define xprintsym |
6b61353c KH |
986 | xgetptr $arg0 |
987 | set $sym = (struct Lisp_Symbol *) $ptr | |
988 | xgetptr $sym->xname | |
989 | set $sym_name = (struct Lisp_String *) $ptr | |
0001e968 | 990 | xprintstr $sym_name |
24b4d1bc GM |
991 | end |
992 | document xprintsym | |
993 | Print argument as a symbol. | |
994 | end | |
995 | ||
d5fb9ac8 KH |
996 | define xcoding |
997 | set $tmp = (struct Lisp_Hash_Table *) ((Vcoding_system_hash_table & $valmask) | gdb_data_seg_bits) | |
998 | set $tmp = (struct Lisp_Vector *) (($tmp->key_and_value & $valmask) | gdb_data_seg_bits) | |
999 | set $name = $tmp->contents[$arg0 * 2] | |
1000 | print $name | |
1001 | pr | |
1002 | print $tmp->contents[$arg0 * 2 + 1] | |
1003 | pr | |
1004 | end | |
1005 | document xcoding | |
8f924df7 | 1006 | Print the name and attributes of coding system that has ID (argument). |
d5fb9ac8 KH |
1007 | end |
1008 | ||
1009 | define xcharset | |
1010 | set $tmp = (struct Lisp_Hash_Table *) ((Vcharset_hash_table & $valmask) | gdb_data_seg_bits) | |
1011 | set $tmp = (struct Lisp_Vector *) (($tmp->key_and_value & $valmask) | gdb_data_seg_bits) | |
1012 | p $tmp->contents[$arg0->hash_index * 2] | |
1013 | pr | |
1014 | end | |
1015 | document xcharset | |
8f924df7 | 1016 | Print the name of charset that has ID (argument). |
d5fb9ac8 KH |
1017 | end |
1018 | ||
9e067dbc KH |
1019 | define xfontset |
1020 | xgetptr $ | |
1021 | set $tbl = (struct Lisp_Char_Table *) $ptr | |
1022 | print $tbl | |
1023 | xgetint $tbl->extras[0] | |
1024 | printf " ID:%d", $int | |
1025 | xgettype $tbl->extras[1] | |
1026 | xgetptr $tbl->extras[1] | |
1027 | if $type == Lisp_String | |
1028 | set $ptr = (struct Lisp_String *) $ptr | |
1029 | printf " Name:" | |
1030 | xprintstr $ptr | |
1031 | else | |
1032 | xgetptr $tbl->extras[2] | |
1033 | set $ptr = (struct Lisp_Char_Table *) $ptr | |
1034 | xgetptr $ptr->extras[1] | |
1035 | set $ptr = (struct Lisp_String *) $ptr | |
1036 | printf " Realized from:" | |
1037 | xprintstr $ptr | |
1038 | end | |
1039 | echo \n | |
1040 | end | |
1041 | ||
322081f1 KH |
1042 | define xfont |
1043 | xgetptr $ | |
1044 | set $size = (((struct Lisp_Vector *) $ptr)->size & 0x1FF) | |
1045 | if $size == FONT_SPEC_MAX | |
1046 | print (struct font_spec *) $ptr | |
1047 | else | |
1048 | if $size == FONT_ENTITY_MAX | |
1049 | print (struct font_entity *) $ptr | |
1050 | else | |
1051 | print (struct font *) $ptr | |
1052 | end | |
1053 | end | |
1054 | end | |
1055 | document xfont | |
1056 | Print $ assuming it is a list font (font-spec, font-entity, or font-object). | |
1057 | end | |
1058 | ||
24b4d1bc GM |
1059 | define xbacktrace |
1060 | set $bt = backtrace_list | |
177c0ea7 | 1061 | while $bt |
6b61353c | 1062 | xgettype (*$bt->function) |
3176a27e | 1063 | if $type == Lisp_Symbol |
6b61353c | 1064 | xprintsym (*$bt->function) |
c51842ec | 1065 | printf " (0x%x)\n", $bt->args |
3176a27e GM |
1066 | else |
1067 | printf "0x%x ", *$bt->function | |
1068 | if $type == Lisp_Vectorlike | |
6b61353c KH |
1069 | xgetptr (*$bt->function) |
1070 | set $size = ((struct Lisp_Vector *) $ptr)->size | |
fc80da24 | 1071 | output ($size & PVEC_FLAG) ? (enum pvec_type) ($size & PVEC_TYPE_MASK) : $size & ~gdb_array_mark_flag |
3176a27e GM |
1072 | else |
1073 | printf "Lisp type %d", $type | |
1074 | end | |
1075 | echo \n | |
1076 | end | |
24b4d1bc GM |
1077 | set $bt = $bt->next |
1078 | end | |
1079 | end | |
1080 | document xbacktrace | |
1081 | Print a backtrace of Lisp function calls from backtrace_list. | |
177c0ea7 | 1082 | Set a breakpoint at Fsignal and call this to see from where |
3176a27e | 1083 | an error was signaled. |
24b4d1bc GM |
1084 | end |
1085 | ||
28c1e1ca KS |
1086 | define which |
1087 | set debug_print (which_symbols ($arg0)) | |
1088 | end | |
1089 | document which | |
89955f2e | 1090 | Print symbols which references a given lisp object |
28c1e1ca KS |
1091 | either as its symbol value or symbol function. |
1092 | end | |
1093 | ||
1094 | define xbytecode | |
1095 | set $bt = byte_stack_list | |
1096 | while $bt | |
1097 | xgettype ($bt->byte_string) | |
1098 | printf "0x%x => ", $bt->byte_string | |
1099 | which $bt->byte_string | |
1100 | set $bt = $bt->next | |
1101 | end | |
1102 | end | |
1103 | document xbytecode | |
1104 | Print a backtrace of the byte code stack. | |
1105 | end | |
1106 | ||
338fa84a KS |
1107 | # Show Lisp backtrace after normal backtrace. |
1108 | define hookpost-backtrace | |
1109 | set $bt = backtrace_list | |
1110 | if $bt | |
1111 | echo \n | |
1112 | echo Lisp Backtrace:\n | |
1113 | xbacktrace | |
1114 | end | |
1115 | end | |
1116 | ||
24b4d1bc | 1117 | define xreload |
6b61353c KH |
1118 | set $tagmask = (((long)1 << gdb_gctypebits) - 1) |
1119 | set $valmask = gdb_use_lsb ? ~($tagmask) : ((long)1 << gdb_valbits) - 1 | |
24b4d1bc GM |
1120 | end |
1121 | document xreload | |
1122 | When starting Emacs a second time in the same gdb session under | |
6b61353c | 1123 | FreeBSD 2.2.5, gdb 4.13, $valmask have lost |
be9e8331 DL |
1124 | their values. (The same happens on current (2000) versions of GNU/Linux |
1125 | with gdb 5.0.) | |
c71ea231 | 1126 | This function reloads them. |
24b4d1bc | 1127 | end |
6b61353c | 1128 | xreload |
24b4d1bc | 1129 | |
6c5d0c52 KS |
1130 | # Flush display (X only) |
1131 | define ff | |
1132 | set x_flush (0) | |
1133 | end | |
1134 | document ff | |
1135 | Flush pending X window display updates to screen. | |
1136 | Works only when an inferior emacs is executing. | |
1137 | end | |
1138 | ||
1139 | ||
be9e8331 DL |
1140 | define hook-run |
1141 | xreload | |
1142 | end | |
1143 | ||
e869a29d RS |
1144 | # Call xreload if a new Emacs executable is loaded. |
1145 | define hookpost-run | |
1146 | xreload | |
1147 | end | |
1148 | ||
e065a56e | 1149 | set print pretty on |
df86e57e | 1150 | set print sevenbit-strings |
a6ffc6a2 | 1151 | |
e5d77022 | 1152 | show environment DISPLAY |
6f5d1a4f | 1153 | show environment TERM |
e5d77022 | 1154 | |
c2c50958 | 1155 | # People get bothered when they see messages about non-existent functions... |
dd878ee1 | 1156 | xgetptr Vsystem_type |
ea5f3ad4 EZ |
1157 | # $ptr is NULL in temacs |
1158 | if ($ptr != 0) | |
1159 | set $tem = (struct Lisp_Symbol *) $ptr | |
1160 | xgetptr $tem->xname | |
1161 | set $tem = (struct Lisp_String *) $ptr | |
1162 | set $tem = (char *) $tem->data | |
1163 | ||
1164 | # Don't let abort actually run, as it will make stdio stop working and | |
1165 | # therefore the `pr' command above as well. | |
1166 | if $tem[0] == 'w' && $tem[1] == 'i' && $tem[2] == 'n' && $tem[3] == 'd' | |
1167 | # The windows-nt build replaces abort with its own function. | |
1168 | break w32_abort | |
1169 | else | |
1170 | break abort | |
1171 | end | |
feaf060a | 1172 | end |
dd878ee1 | 1173 | |
feaf060a EZ |
1174 | # x_error_quitter is defined only on X. But window-system is set up |
1175 | # only at run time, during Emacs startup, so we need to defer setting | |
1176 | # the breakpoint. init_sys_modes is the first function called on | |
1177 | # every platform after init_display, where window-system is set. | |
1178 | tbreak init_sys_modes | |
1179 | commands | |
1180 | silent | |
4fd9de39 | 1181 | xgetptr Vinitial_window_system |
913645cd EZ |
1182 | set $tem = (struct Lisp_Symbol *) $ptr |
1183 | xgetptr $tem->xname | |
1184 | set $tem = (struct Lisp_String *) $ptr | |
1185 | set $tem = (char *) $tem->data | |
feaf060a EZ |
1186 | # If we are running in synchronous mode, we want a chance to look |
1187 | # around before Emacs exits. Perhaps we should put the break | |
1188 | # somewhere else instead... | |
913645cd | 1189 | if $tem[0] == 'x' && $tem[1] == '\0' |
2d90e492 | 1190 | break x_error_quitter |
913645cd | 1191 | end |
feaf060a | 1192 | continue |
dd878ee1 | 1193 | end |
6b61353c | 1194 | # arch-tag: 12f34321-7bfa-4240-b77a-3cd3a1696dfe |