68651
|
1 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001,
|
|
2 # 2004, 2005, 2006 Free Software Foundation, Inc.
|
36219
|
3 #
|
|
4 # This file is part of GNU Emacs.
|
|
5 #
|
|
6 # GNU Emacs is free software; you can redistribute it and/or modify
|
|
7 # it under the terms of the GNU General Public License as published by
|
|
8 # the Free Software Foundation; either version 2, or (at your option)
|
|
9 # any later version.
|
|
10 #
|
|
11 # GNU Emacs is distributed in the hope that it will be useful,
|
|
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14 # GNU General Public License for more details.
|
|
15 #
|
|
16 # You should have received a copy of the GNU General Public License
|
|
17 # along with GNU Emacs; see the file COPYING. If not, write to the
|
64084
|
18 # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
19 # Boston, MA 02110-1301, USA.
|
36219
|
20
|
13359
|
21 # Force loading of symbols, enough to give us gdb_valbits etc.
|
|
22 set main
|
|
23
|
15536
|
24 # Find lwlib source files too.
|
|
25 dir ../lwlib
|
34876
|
26 #dir /gd/gnu/lesstif-0.89.9/lib/Xm
|
15536
|
27
|
20672
|
28 # Don't enter GDB when user types C-g to quit.
|
|
29 # This has one unfortunate effect: you can't type C-c
|
|
30 # at the GDB to stop Emacs, when using X.
|
|
31 # However, C-z works just as well in that case.
|
67027
|
32 handle 2 noprint pass
|
20672
|
33
|
66903
|
34 # Make it work like SIGINT normally does.
|
|
35 handle SIGTSTP nopass
|
|
36
|
30636
|
37 # Don't pass SIGALRM to Emacs. This makes problems when
|
|
38 # debugging.
|
|
39 handle SIGALRM ignore
|
|
40
|
59660
|
41 # $valmask and $tagmask are mask values set up by the xreload macro below.
|
54690
|
42
|
59660
|
43 # Use $bugfix so that the value isn't a constant.
|
|
44 # Using a constant runs into GDB bugs sometimes.
|
54690
|
45 define xgetptr
|
59660
|
46 set $bugfix = $arg0
|
|
47 set $ptr = (gdb_use_union ? $bugfix.u.val : $bugfix & $valmask) | gdb_data_seg_bits
|
54690
|
48 end
|
|
49
|
|
50 define xgetint
|
59660
|
51 set $bugfix = $arg0
|
|
52 set $int = gdb_use_union ? $bugfix.s.val : (gdb_use_lsb ? $bugfix : $bugfix << gdb_gctypebits) >> gdb_gctypebits
|
54690
|
53 end
|
|
54
|
|
55 define xgettype
|
59660
|
56 set $bugfix = $arg0
|
|
57 set $type = gdb_use_union ? $bugfix.s.type : (enum Lisp_Type) (gdb_use_lsb ? $bugfix & $tagmask : $bugfix >> gdb_valbits)
|
54690
|
58 end
|
11872
|
59
|
567
|
60 # Set up something to print out s-expressions.
|
69679
|
61 # We save and restore print_output_debug_flag to prevent the w32 port
|
|
62 # from calling OutputDebugString, which causes GDB to display each
|
|
63 # character twice (yuk!).
|
567
|
64 define pr
|
69679
|
65 set $output_debug = print_output_debug_flag
|
|
66 set print_output_debug_flag = 0
|
54690
|
67 set debug_print ($)
|
69679
|
68 set print_output_debug_flag = $output_debug
|
567
|
69 end
|
|
70 document pr
|
|
71 Print the emacs s-expression which is $.
|
|
72 Works only when an inferior emacs is executing.
|
|
73 end
|
|
74
|
57306
|
75 # Print out s-expressions
|
|
76 define pp
|
|
77 set $tmp = $arg0
|
69679
|
78 set $output_debug = print_output_debug_flag
|
|
79 set print_output_debug_flag = 0
|
66776
|
80 set safe_debug_print ($tmp)
|
69679
|
81 set print_output_debug_flag = $output_debug
|
57306
|
82 end
|
|
83 document pp
|
|
84 Print the argument as an emacs s-expression
|
|
85 Works only when an inferior emacs is executing.
|
|
86 end
|
|
87
|
66772
|
88 # Print out s-expressions from tool bar
|
|
89 define pp1
|
|
90 set $tmp = $arg0
|
69679
|
91 set $output_debug = print_output_debug_flag
|
|
92 set print_output_debug_flag = 0
|
66776
|
93 set safe_debug_print ($tmp)
|
69679
|
94 set print_output_debug_flag = $output_debug
|
66772
|
95 end
|
|
96 document pp1
|
70247
039ae41bde1a
(pp1, pv1): Only print value as expression is now printed out by gud-print.
Nick Roberts <nickrob@snap.net.nz>
diff
changeset
|
97 Print the argument as an emacs s-expression.
|
66772
|
98 Works only when an inferior emacs is executing.
|
|
99 For use on tool bar when debugging in Emacs
|
|
100 where the variable name would not otherwise
|
|
101 be recorded in the GUD buffer.
|
|
102 end
|
|
103
|
66776
|
104 # Print value of lisp variable
|
|
105 define pv
|
|
106 set $tmp = "$arg0"
|
69679
|
107 set $output_debug = print_output_debug_flag
|
|
108 set print_output_debug_flag = 0
|
66776
|
109 set safe_debug_print ( find_symbol_value (intern ($tmp)))
|
69679
|
110 set print_output_debug_flag = $output_debug
|
66776
|
111 end
|
|
112 document pv
|
|
113 Print the value of the lisp variable given as argument.
|
|
114 Works only when an inferior emacs is executing.
|
|
115 end
|
|
116
|
|
117 # Print value of lisp variable
|
|
118 define pv1
|
|
119 set $tmp = "$arg0"
|
69679
|
120 set $output_debug = print_output_debug_flag
|
|
121 set print_output_debug_flag = 0
|
66776
|
122 set safe_debug_print (find_symbol_value (intern ($tmp)))
|
69679
|
123 set print_output_debug_flag = $output_debug
|
66776
|
124 end
|
|
125 document pv1
|
|
126 Print the value of the lisp variable given as argument.
|
|
127 Works only when an inferior emacs is executing.
|
70247
039ae41bde1a
(pp1, pv1): Only print value as expression is now printed out by gud-print.
Nick Roberts <nickrob@snap.net.nz>
diff
changeset
|
128 For use when debugging in Emacs where the variable
|
039ae41bde1a
(pp1, pv1): Only print value as expression is now printed out by gud-print.
Nick Roberts <nickrob@snap.net.nz>
diff
changeset
|
129 name would not otherwise be recorded in the GUD buffer.
|
66776
|
130 end
|
|
131
|
57911
|
132 # Print out current buffer point and boundaries
|
|
133 define ppt
|
|
134 set $b = current_buffer
|
|
135 set $t = $b->text
|
|
136 printf "BUF PT: %d", $b->pt
|
|
137 if ($b->pt != $b->pt_byte)
|
|
138 printf "[%d]", $b->pt_byte
|
|
139 end
|
|
140 printf " of 1..%d", $t->z
|
|
141 if ($t->z != $t->z_byte)
|
|
142 printf "[%d]", $t->z_byte
|
|
143 end
|
|
144 if ($b->begv != 1 || $b->zv != $t->z)
|
|
145 printf " NARROW=%d..%d", $b->begv, $b->zv
|
|
146 if ($b->begv != $b->begv_byte || $b->zv != $b->zv_byte)
|
|
147 printf " [%d..%d]", $b->begv_byte, $b->zv_byte
|
|
148 end
|
|
149 end
|
|
150 printf " GAP: %d", $t->gpt
|
|
151 if ($t->gpt != $t->gpt_byte)
|
|
152 printf "[%d]", $t->gpt_byte
|
|
153 end
|
|
154 printf " SZ=%d\n", $t->gap_size
|
|
155 end
|
|
156 document ppt
|
|
157 Print point, beg, end, narrow, and gap for current buffer.
|
|
158 end
|
|
159
|
60148
|
160 # Print out iterator given as first arg
|
|
161 define pitx
|
|
162 set $it = $arg0
|
|
163 printf "cur=%d", $it->current.pos.charpos
|
|
164 if ($it->current.pos.charpos != $it->current.pos.bytepos)
|
|
165 printf "[%d]", $it->current.pos.bytepos
|
|
166 end
|
|
167 printf " start=%d", $it->start.pos.charpos
|
|
168 if ($it->start.pos.charpos != $it->start.pos.bytepos)
|
|
169 printf "[%d]", $it->start.pos.bytepos
|
|
170 end
|
62416
|
171 printf " end=%d", $it->end_charpos
|
|
172 printf " stop=%d", $it->stop_charpos
|
|
173 printf " face=%d", $it->face_id
|
|
174 if ($it->multibyte_p)
|
|
175 printf " MB"
|
|
176 end
|
|
177 if ($it->header_line_p)
|
|
178 printf " HL"
|
|
179 end
|
|
180 if ($it->n_overlay_strings > 0)
|
66817
|
181 printf " nov=%d", $it->n_overlay_strings
|
62416
|
182 end
|
|
183 if ($it->sp != 0)
|
|
184 printf " sp=%d", $it->sp
|
|
185 end
|
60148
|
186 if ($it->what == IT_CHARACTER)
|
|
187 if ($it->len == 1 && $it->c >= ' ' && it->c < 255)
|
64321
|
188 printf " ch='%c'", $it->c
|
60148
|
189 else
|
64321
|
190 printf " ch=[%d,%d]", $it->c, $it->len
|
62416
|
191 end
|
|
192 else
|
|
193 if ($it->what == IT_IMAGE)
|
64321
|
194 printf " IMAGE=%d", $it->image_id
|
62416
|
195 else
|
64321
|
196 printf " "
|
62416
|
197 output $it->what
|
60148
|
198 end
|
|
199 end
|
62416
|
200 if ($it->method != GET_FROM_BUFFER)
|
|
201 printf " next="
|
|
202 output $it->method
|
64321
|
203 if ($it->method == GET_FROM_STRING)
|
|
204 printf "[%d]", $it->current.string_pos.charpos
|
|
205 end
|
62416
|
206 end
|
60148
|
207 printf "\n"
|
62416
|
208 if ($it->region_beg_charpos >= 0)
|
|
209 printf "reg=%d-%d ", $it->region_beg_charpos, $it->region_end_charpos
|
|
210 end
|
60148
|
211 printf "vpos=%d hpos=%d", $it->vpos, $it->hpos,
|
|
212 printf " y=%d lvy=%d", $it->current_y, $it->last_visible_y
|
62416
|
213 printf " x=%d vx=%d-%d", $it->current_x, $it->first_visible_x, $it->last_visible_x
|
60148
|
214 printf " a+d=%d+%d=%d", $it->ascent, $it->descent, $it->ascent+$it->descent
|
|
215 printf " max=%d+%d=%d", $it->max_ascent, $it->max_descent, $it->max_ascent+$it->max_descent
|
|
216 printf "\n"
|
|
217 end
|
|
218 document pitx
|
|
219 Pretty print a display iterator.
|
|
220 Take one arg, an iterator object or pointer.
|
|
221 end
|
|
222
|
|
223 define pit
|
|
224 pitx it
|
|
225 end
|
|
226 document pit
|
|
227 Pretty print the display iterator it.
|
|
228 end
|
|
229
|
|
230 define prowx
|
|
231 set $row = $arg0
|
|
232 printf "y=%d x=%d pwid=%d", $row->y, $row->x, $row->pixel_width
|
|
233 printf " a+d=%d+%d=%d", $row->ascent, $row->height-$row->ascent, $row->height
|
|
234 printf " phys=%d+%d=%d", $row->phys_ascent, $row->phys_height-$row->phys_ascent, $row->phys_height
|
|
235 printf " vis=%d", $row->visible_height
|
|
236 printf " L=%d T=%d R=%d", $row->used[0], $row->used[1], $row->used[2]
|
|
237 printf "\n"
|
|
238 printf "start=%d end=%d", $row->start.pos.charpos, $row->end.pos.charpos
|
|
239 if ($row->enabled_p)
|
|
240 printf " ENA"
|
|
241 end
|
|
242 if ($row->displays_text_p)
|
|
243 printf " DISP"
|
|
244 end
|
|
245 if ($row->mode_line_p)
|
|
246 printf " MODEL"
|
|
247 end
|
|
248 if ($row->continued_p)
|
|
249 printf " CONT"
|
|
250 end
|
|
251 if ($row-> truncated_on_left_p)
|
|
252 printf " TRUNC:L"
|
|
253 end
|
|
254 if ($row-> truncated_on_right_p)
|
|
255 printf " TRUNC:R"
|
|
256 end
|
|
257 if ($row->starts_in_middle_of_char_p)
|
|
258 printf " STARTMID"
|
|
259 end
|
|
260 if ($row->ends_in_middle_of_char_p)
|
|
261 printf " ENDMID"
|
|
262 end
|
|
263 if ($row->ends_in_newline_from_string_p)
|
|
264 printf " ENDNLFS"
|
|
265 end
|
|
266 if ($row->ends_at_zv_p)
|
|
267 printf " ENDZV"
|
|
268 end
|
|
269 if ($row->overlapped_p)
|
|
270 printf " OLAPD"
|
|
271 end
|
|
272 if ($row->overlapping_p)
|
|
273 printf " OLAPNG"
|
|
274 end
|
|
275 printf "\n"
|
|
276 end
|
|
277 document prowx
|
|
278 Pretty print information about glyph_row.
|
|
279 Takes one argument, a row object or pointer.
|
|
280 end
|
|
281
|
|
282 define prow
|
|
283 prowx row
|
|
284 end
|
|
285 document prow
|
|
286 Pretty print information about glyph_row in row.
|
|
287 end
|
|
288
|
|
289
|
|
290 define pcursorx
|
|
291 set $cp = $arg0
|
|
292 printf "y=%d x=%d vpos=%d hpos=%d", $cp->y, $cp->x, $cp->vpos, $cp->hpos
|
|
293 end
|
|
294 document pcursorx
|
|
295 Pretty print a window cursor
|
|
296 end
|
|
297
|
|
298 define pcursor
|
|
299 printf "output: "
|
|
300 pcursorx output_cursor
|
|
301 printf "\n"
|
|
302 end
|
|
303 document pcursor
|
|
304 Pretty print the output_cursor
|
|
305 end
|
|
306
|
|
307 define pwinx
|
|
308 set $w = $arg0
|
|
309 xgetint $w->sequence_number
|
|
310 if ($w->mini_p != Qnil)
|
|
311 printf "Mini "
|
|
312 end
|
|
313 printf "Window %d ", $int
|
|
314 xgetptr $w->buffer
|
|
315 set $tem = (struct buffer *) $ptr
|
|
316 xgetptr $tem->name
|
|
317 printf "%s", ((struct Lisp_String *) $ptr)->data
|
|
318 printf "\n"
|
|
319 xgetptr $w->start
|
|
320 set $tem = (struct Lisp_Marker *) $ptr
|
|
321 printf "start=%d end:", $tem->charpos
|
|
322 if ($w->window_end_valid != Qnil)
|
|
323 xgetint $w->window_end_pos
|
|
324 printf "pos=%d", $int
|
|
325 xgetint $w->window_end_vpos
|
|
326 printf " vpos=%d", $int
|
|
327 else
|
|
328 printf "invalid"
|
|
329 end
|
|
330 printf " vscroll=%d", $w->vscroll
|
|
331 if ($w->force_start != Qnil)
|
|
332 printf " FORCE_START"
|
|
333 end
|
|
334 if ($w->must_be_updated_p)
|
|
335 printf " MUST_UPD"
|
|
336 end
|
|
337 printf "\n"
|
|
338 printf "cursor: "
|
|
339 pcursorx $w->cursor
|
|
340 printf " phys: "
|
|
341 pcursorx $w->phys_cursor
|
|
342 if ($w->phys_cursor_on_p)
|
|
343 printf " ON"
|
|
344 else
|
|
345 printf " OFF"
|
|
346 end
|
|
347 printf " blk="
|
|
348 if ($w->last_cursor_off_p != $w->cursor_off_p)
|
|
349 if ($w->last_cursor_off_p)
|
|
350 printf "ON->"
|
|
351 else
|
|
352 printf "OFF->"
|
|
353 end
|
|
354 end
|
|
355 if ($w->cursor_off_p)
|
|
356 printf "ON"
|
|
357 else
|
|
358 printf "OFF"
|
|
359 end
|
|
360 printf "\n"
|
|
361 end
|
|
362 document pwinx
|
|
363 Pretty print a window structure.
|
|
364 Takes one argument, a pointer to a window structure
|
|
365 end
|
|
366
|
|
367 define pwin
|
|
368 pwinx w
|
|
369 end
|
|
370 document pwin
|
|
371 Pretty print window structure w.
|
|
372 end
|
|
373
|
|
374
|
567
|
375 define xtype
|
54690
|
376 xgettype $
|
|
377 output $type
|
|
378 echo \n
|
|
379 if $type == Lisp_Misc
|
|
380 xmisctype
|
|
381 else
|
|
382 if $type == Lisp_Vectorlike
|
|
383 xvectype
|
|
384 end
|
|
385 end
|
567
|
386 end
|
638
|
387 document xtype
|
7962
|
388 Print the type of $, assuming it is an Emacs Lisp value.
|
10299
|
389 If the first type printed is Lisp_Vector or Lisp_Misc,
|
54690
|
390 a second line gives the more precise type.
|
10299
|
391 end
|
|
392
|
|
393 define xvectype
|
54690
|
394 xgetptr $
|
|
395 set $size = ((struct Lisp_Vector *) $ptr)->size
|
55609
|
396 output ($size & PVEC_FLAG) ? (enum pvec_type) ($size & PVEC_TYPE_MASK) : $size & ~gdb_array_mark_flag
|
54690
|
397 echo \n
|
10299
|
398 end
|
|
399 document xvectype
|
54690
|
400 Print the size or vector subtype of $, assuming it is a vector or pseudovector.
|
10299
|
401 end
|
|
402
|
|
403 define xmisctype
|
54690
|
404 xgetptr $
|
|
405 output (enum Lisp_Misc_Type) (((struct Lisp_Free *) $ptr)->type)
|
|
406 echo \n
|
10299
|
407 end
|
|
408 document xmisctype
|
|
409 Print the specific type of $, assuming it is some misc type.
|
638
|
410 end
|
567
|
411
|
|
412 define xint
|
54690
|
413 xgetint $
|
|
414 print $int
|
567
|
415 end
|
638
|
416 document xint
|
7962
|
417 Print $, assuming it is an Emacs Lisp integer. This gets the sign right.
|
638
|
418 end
|
567
|
419
|
|
420 define xptr
|
54690
|
421 xgetptr $
|
|
422 print (void *) $ptr
|
567
|
423 end
|
638
|
424 document xptr
|
7962
|
425 Print the pointer portion of $, assuming it is an Emacs Lisp value.
|
638
|
426 end
|
567
|
427
|
|
428 define xmarker
|
54690
|
429 xgetptr $
|
|
430 print (struct Lisp_Marker *) $ptr
|
567
|
431 end
|
638
|
432 document xmarker
|
7962
|
433 Print $ as a marker pointer, assuming it is an Emacs Lisp marker value.
|
638
|
434 end
|
567
|
435
|
10483
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
436 define xoverlay
|
54690
|
437 xgetptr $
|
|
438 print (struct Lisp_Overlay *) $ptr
|
10483
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
439 end
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
440 document xoverlay
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
441 Print $ as a overlay pointer, assuming it is an Emacs Lisp overlay value.
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
442 end
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
443
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
444 define xmiscfree
|
54690
|
445 xgetptr $
|
|
446 print (struct Lisp_Free *) $ptr
|
10483
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
447 end
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
448 document xmiscfree
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
449 Print $ as a misc free-cell pointer, assuming it is an Emacs Lisp Misc value.
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
450 end
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
451
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
452 define xintfwd
|
54690
|
453 xgetptr $
|
|
454 print (struct Lisp_Intfwd *) $ptr
|
10483
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
455 end
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
456 document xintfwd
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
457 Print $ as an integer forwarding pointer, assuming it is an Emacs Lisp Misc value.
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
458 end
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
459
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
460 define xboolfwd
|
54690
|
461 xgetptr $
|
|
462 print (struct Lisp_Boolfwd *) $ptr
|
10483
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
463 end
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
464 document xboolfwd
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
465 Print $ as a boolean forwarding pointer, assuming it is an Emacs Lisp Misc value.
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
466 end
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
467
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
468 define xobjfwd
|
54690
|
469 xgetptr $
|
|
470 print (struct Lisp_Objfwd *) $ptr
|
10483
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
471 end
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
472 document xobjfwd
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
473 Print $ as an object forwarding pointer, assuming it is an Emacs Lisp Misc value.
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
474 end
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
475
|
10495
|
476 define xbufobjfwd
|
54690
|
477 xgetptr $
|
|
478 print (struct Lisp_Buffer_Objfwd *) $ptr
|
10483
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
479 end
|
10495
|
480 document xbufobjfwd
|
10483
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
481 Print $ as a buffer-local object forwarding pointer, assuming it is an Emacs Lisp Misc value.
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
482 end
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
483
|
11006
|
484 define xkbobjfwd
|
54690
|
485 xgetptr $
|
|
486 print (struct Lisp_Kboard_Objfwd *) $ptr
|
10582
|
487 end
|
11006
|
488 document xkbobjfwd
|
|
489 Print $ as a kboard-local object forwarding pointer, assuming it is an Emacs Lisp Misc value.
|
10582
|
490 end
|
|
491
|
10495
|
492 define xbuflocal
|
54690
|
493 xgetptr $
|
|
494 print (struct Lisp_Buffer_Local_Value *) $ptr
|
10483
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
495 end
|
10495
|
496 document xbuflocal
|
10483
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
497 Print $ as a buffer-local-value pointer, assuming it is an Emacs Lisp Misc value.
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
498 end
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
499
|
567
|
500 define xsymbol
|
55686
|
501 set $sym = $
|
|
502 xgetptr $sym
|
54690
|
503 print (struct Lisp_Symbol *) $ptr
|
55686
|
504 xprintsym $sym
|
54690
|
505 echo \n
|
567
|
506 end
|
638
|
507 document xsymbol
|
|
508 Print the name and address of the symbol $.
|
7962
|
509 This command assumes that $ is an Emacs Lisp symbol value.
|
638
|
510 end
|
567
|
511
|
|
512 define xstring
|
54690
|
513 xgetptr $
|
|
514 print (struct Lisp_String *) $ptr
|
55681
|
515 xprintstr $
|
54690
|
516 echo \n
|
567
|
517 end
|
|
518 document xstring
|
638
|
519 Print the contents and address of the string $.
|
7962
|
520 This command assumes that $ is an Emacs Lisp string value.
|
567
|
521 end
|
|
522
|
|
523 define xvector
|
54690
|
524 xgetptr $
|
|
525 print (struct Lisp_Vector *) $ptr
|
55609
|
526 output ($->size > 50) ? 0 : ($->contents[0])@($->size & ~gdb_array_mark_flag)
|
999
|
527 echo \n
|
567
|
528 end
|
|
529 document xvector
|
638
|
530 Print the contents and address of the vector $.
|
7962
|
531 This command assumes that $ is an Emacs Lisp vector value.
|
567
|
532 end
|
|
533
|
22012
|
534 define xprocess
|
54690
|
535 xgetptr $
|
|
536 print (struct Lisp_Process *) $ptr
|
|
537 output *$
|
|
538 echo \n
|
22012
|
539 end
|
|
540 document xprocess
|
|
541 Print the address of the struct Lisp_process which the Lisp_Object $ points to.
|
|
542 end
|
|
543
|
1113
|
544 define xframe
|
54690
|
545 xgetptr $
|
|
546 print (struct frame *) $ptr
|
567
|
547 end
|
1113
|
548 document xframe
|
7962
|
549 Print $ as a frame pointer, assuming it is an Emacs Lisp frame value.
|
638
|
550 end
|
567
|
551
|
22012
|
552 define xcompiled
|
54690
|
553 xgetptr $
|
|
554 print (struct Lisp_Vector *) $ptr
|
|
555 output ($->contents[0])@($->size & 0xff)
|
22012
|
556 end
|
|
557 document xcompiled
|
|
558 Print $ as a compiled function pointer, assuming it is an Emacs Lisp compiled value.
|
|
559 end
|
|
560
|
|
561 define xwindow
|
54690
|
562 xgetptr $
|
|
563 print (struct window *) $ptr
|
68857
|
564 set $window = (struct window *) $ptr
|
|
565 xgetint $window->total_cols
|
|
566 set $width=$int
|
|
567 xgetint $window->total_lines
|
|
568 set $height=$int
|
|
569 xgetint $window->left_col
|
|
570 set $left=$int
|
|
571 xgetint $window->top_line
|
|
572 set $top=$int
|
|
573 printf "%dx%d+%d+%d\n", $width, $height, $left, $top
|
22012
|
574 end
|
|
575 document xwindow
|
|
576 Print $ as a window pointer, assuming it is an Emacs Lisp window value.
|
|
577 Print the window's position as "WIDTHxHEIGHT+LEFT+TOP".
|
|
578 end
|
|
579
|
10495
|
580 define xwinconfig
|
54690
|
581 xgetptr $
|
|
582 print (struct save_window_data *) $ptr
|
10483
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
583 end
|
10495
|
584 document xwinconfig
|
10483
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
585 Print $ as a window configuration pointer, assuming it is an Emacs Lisp window configuration value.
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
586 end
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
587
|
22012
|
588 define xsubr
|
54690
|
589 xgetptr $
|
|
590 print (struct Lisp_Subr *) $ptr
|
|
591 output *$
|
|
592 echo \n
|
22012
|
593 end
|
|
594 document xsubr
|
|
595 Print the address of the subr which the Lisp_Object $ points to.
|
|
596 end
|
|
597
|
|
598 define xchartable
|
54690
|
599 xgetptr $
|
|
600 print (struct Lisp_Char_Table *) $ptr
|
|
601 printf "Purpose: "
|
|
602 xprintsym $->purpose
|
|
603 printf " %d extra slots", ($->size & 0x1ff) - 388
|
|
604 echo \n
|
22012
|
605 end
|
|
606 document xchartable
|
|
607 Print the address of the char-table $, and its purpose.
|
|
608 This command assumes that $ is an Emacs Lisp char-table value.
|
10483
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
609 end
|
22012
|
610
|
|
611 define xboolvector
|
54690
|
612 xgetptr $
|
|
613 print (struct Lisp_Bool_Vector *) $ptr
|
55609
|
614 output ($->size > 256) ? 0 : ($->data[0])@((($->size & ~gdb_array_mark_flag) + 7)/ 8)
|
54690
|
615 echo \n
|
22012
|
616 end
|
|
617 document xboolvector
|
|
618 Print the contents and address of the bool-vector $.
|
|
619 This command assumes that $ is an Emacs Lisp bool-vector value.
|
|
620 end
|
|
621
|
|
622 define xbuffer
|
54690
|
623 xgetptr $
|
|
624 print (struct buffer *) $ptr
|
|
625 xgetptr $->name
|
|
626 output ((struct Lisp_String *) $ptr)->data
|
|
627 echo \n
|
22012
|
628 end
|
|
629 document xbuffer
|
|
630 Set $ as a buffer pointer, assuming it is an Emacs Lisp buffer value.
|
|
631 Print the name of the buffer.
|
10483
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
632 end
|
727cd2061e2a
(xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
633
|
30636
|
634 define xhashtable
|
54690
|
635 xgetptr $
|
|
636 print (struct Lisp_Hash_Table *) $ptr
|
30636
|
637 end
|
|
638 document xhashtable
|
|
639 Set $ as a hash table pointer, assuming it is an Emacs Lisp hash table value.
|
|
640 end
|
|
641
|
567
|
642 define xcons
|
54690
|
643 xgetptr $
|
|
644 print (struct Lisp_Cons *) $ptr
|
|
645 output/x *$
|
|
646 echo \n
|
567
|
647 end
|
638
|
648 document xcons
|
7962
|
649 Print the contents of $, assuming it is an Emacs Lisp cons.
|
638
|
650 end
|
567
|
651
|
18522
|
652 define nextcons
|
67020
|
653 p $.u.cdr
|
54690
|
654 xcons
|
18522
|
655 end
|
|
656 document nextcons
|
|
657 Print the contents of the next cell in a list.
|
|
658 This assumes that the last thing you printed was a cons cell contents
|
|
659 (type struct Lisp_Cons) or a pointer to one.
|
|
660 end
|
567
|
661 define xcar
|
54690
|
662 xgetptr $
|
|
663 xgettype $
|
|
664 print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->car : 0)
|
567
|
665 end
|
638
|
666 document xcar
|
7962
|
667 Print the car of $, assuming it is an Emacs Lisp pair.
|
638
|
668 end
|
567
|
669
|
|
670 define xcdr
|
54690
|
671 xgetptr $
|
|
672 xgettype $
|
67020
|
673 print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->u.cdr : 0)
|
567
|
674 end
|
638
|
675 document xcdr
|
7962
|
676 Print the cdr of $, assuming it is an Emacs Lisp pair.
|
638
|
677 end
|
567
|
678
|
4267
|
679 define xfloat
|
54690
|
680 xgetptr $
|
67020
|
681 print ((struct Lisp_Float *) $ptr)->u.data
|
4267
|
682 end
|
|
683 document xfloat
|
|
684 Print $ assuming it is a lisp floating-point number.
|
|
685 end
|
|
686
|
1789
|
687 define xscrollbar
|
54690
|
688 xgetptr $
|
|
689 print (struct scrollbar *) $ptr
|
1789
|
690 output *$
|
|
691 echo \n
|
|
692 end
|
4268
|
693 document xscrollbar
|
1789
|
694 Print $ as a scrollbar pointer.
|
|
695 end
|
|
696
|
55681
|
697 define xprintstr
|
|
698 set $data = $arg0->data
|
|
699 output ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~gdb_array_mark_flag : $arg0->size_byte)
|
|
700 end
|
|
701
|
27290
|
702 define xprintsym
|
54690
|
703 xgetptr $arg0
|
|
704 set $sym = (struct Lisp_Symbol *) $ptr
|
|
705 xgetptr $sym->xname
|
|
706 set $sym_name = (struct Lisp_String *) $ptr
|
55681
|
707 xprintstr $sym_name
|
27290
|
708 end
|
|
709 document xprintsym
|
|
710 Print argument as a symbol.
|
|
711 end
|
|
712
|
|
713 define xbacktrace
|
|
714 set $bt = backtrace_list
|
49600
|
715 while $bt
|
54690
|
716 xgettype (*$bt->function)
|
32812
|
717 if $type == Lisp_Symbol
|
54690
|
718 xprintsym (*$bt->function)
|
|
719 echo \n
|
32812
|
720 else
|
|
721 printf "0x%x ", *$bt->function
|
|
722 if $type == Lisp_Vectorlike
|
54690
|
723 xgetptr (*$bt->function)
|
|
724 set $size = ((struct Lisp_Vector *) $ptr)->size
|
55609
|
725 output ($size & PVEC_FLAG) ? (enum pvec_type) ($size & PVEC_TYPE_MASK) : $size & ~gdb_array_mark_flag
|
32812
|
726 else
|
|
727 printf "Lisp type %d", $type
|
|
728 end
|
|
729 echo \n
|
|
730 end
|
27290
|
731 set $bt = $bt->next
|
|
732 end
|
|
733 end
|
|
734 document xbacktrace
|
|
735 Print a backtrace of Lisp function calls from backtrace_list.
|
49600
|
736 Set a breakpoint at Fsignal and call this to see from where
|
32812
|
737 an error was signaled.
|
27290
|
738 end
|
|
739
|
66817
|
740 # Show Lisp backtrace after normal backtrace.
|
|
741 define hookpost-backtrace
|
|
742 set $bt = backtrace_list
|
|
743 if $bt
|
|
744 echo \n
|
|
745 echo Lisp Backtrace:\n
|
|
746 xbacktrace
|
|
747 end
|
|
748 end
|
|
749
|
27290
|
750 define xreload
|
54690
|
751 set $tagmask = (((long)1 << gdb_gctypebits) - 1)
|
|
752 set $valmask = gdb_use_lsb ? ~($tagmask) : ((long)1 << gdb_valbits) - 1
|
27290
|
753 end
|
|
754 document xreload
|
|
755 When starting Emacs a second time in the same gdb session under
|
54690
|
756 FreeBSD 2.2.5, gdb 4.13, $valmask have lost
|
35792
|
757 their values. (The same happens on current (2000) versions of GNU/Linux
|
|
758 with gdb 5.0.)
|
31960
|
759 This function reloads them.
|
27290
|
760 end
|
54690
|
761 xreload
|
27290
|
762
|
57306
|
763 # Flush display (X only)
|
|
764 define ff
|
|
765 set x_flush (0)
|
|
766 end
|
|
767 document ff
|
|
768 Flush pending X window display updates to screen.
|
|
769 Works only when an inferior emacs is executing.
|
|
770 end
|
|
771
|
|
772
|
35792
|
773 define hook-run
|
|
774 xreload
|
|
775 end
|
|
776
|
42907
|
777 # Call xreload if a new Emacs executable is loaded.
|
|
778 define hookpost-run
|
|
779 xreload
|
|
780 end
|
|
781
|
638
|
782 set print pretty on
|
4267
|
783 set print sevenbit-strings
|
567
|
784
|
732
|
785 show environment DISPLAY
|
4487
|
786 show environment TERM
|
67027
|
787 set args -geometry 80x40+0+0
|
732
|
788
|
67925
477140fdc860
Tell users not to worry about GDB warnings that some functions do not
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
789 # People get bothered when they see messages about non-existent functions...
|
68007
|
790 xgetptr Vsystem_type
|
68297
|
791 # $ptr is NULL in temacs
|
|
792 if ($ptr != 0)
|
|
793 set $tem = (struct Lisp_Symbol *) $ptr
|
|
794 xgetptr $tem->xname
|
|
795 set $tem = (struct Lisp_String *) $ptr
|
|
796 set $tem = (char *) $tem->data
|
67925
477140fdc860
Tell users not to worry about GDB warnings that some functions do not
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
797
|
68297
|
798 # Don't let abort actually run, as it will make stdio stop working and
|
|
799 # therefore the `pr' command above as well.
|
|
800 if $tem[0] == 'w' && $tem[1] == 'i' && $tem[2] == 'n' && $tem[3] == 'd'
|
|
801 # The windows-nt build replaces abort with its own function.
|
|
802 break w32_abort
|
|
803 else
|
|
804 break abort
|
|
805 end
|
68047
|
806 end
|
567
|
807
|
68047
|
808 # x_error_quitter is defined only on X. But window-system is set up
|
|
809 # only at run time, during Emacs startup, so we need to defer setting
|
|
810 # the breakpoint. init_sys_modes is the first function called on
|
|
811 # every platform after init_display, where window-system is set.
|
|
812 tbreak init_sys_modes
|
|
813 commands
|
|
814 silent
|
68024
|
815 xgetptr Vwindow_system
|
|
816 set $tem = (struct Lisp_Symbol *) $ptr
|
|
817 xgetptr $tem->xname
|
|
818 set $tem = (struct Lisp_String *) $ptr
|
|
819 set $tem = (char *) $tem->data
|
68047
|
820 # If we are running in synchronous mode, we want a chance to look
|
|
821 # around before Emacs exits. Perhaps we should put the break
|
|
822 # somewhere else instead...
|
68024
|
823 if $tem[0] == 'x' && $tem[1] == '\0'
|
68052
|
824 break x_error_quitter
|
68024
|
825 end
|
68047
|
826 continue
|
68007
|
827 end
|
52401
|
828 # arch-tag: 12f34321-7bfa-4240-b77a-3cd3a1696dfe
|