annotate src/.gdbinit @ 35397:cfa217f01995

*** empty log message ***
author Gerd Moellmann <gerd@gnu.org>
date Thu, 18 Jan 2001 13:46:46 +0000
parents 8dbc92d11de2
children 9ec1e59890a2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13359
4c60f92bdaa6 Do `set main' to make gdb_valbits etc. available.
Richard M. Stallman <rms@gnu.org>
parents: 12278
diff changeset
1 # Force loading of symbols, enough to give us gdb_valbits etc.
4c60f92bdaa6 Do `set main' to make gdb_valbits etc. available.
Richard M. Stallman <rms@gnu.org>
parents: 12278
diff changeset
2 set main
4c60f92bdaa6 Do `set main' to make gdb_valbits etc. available.
Richard M. Stallman <rms@gnu.org>
parents: 12278
diff changeset
3
15536
fb218a8bd186 Add `dir ../lwlib'.
Richard M. Stallman <rms@gnu.org>
parents: 13551
diff changeset
4 # Find lwlib source files too.
fb218a8bd186 Add `dir ../lwlib'.
Richard M. Stallman <rms@gnu.org>
parents: 13551
diff changeset
5 dir ../lwlib
34876
8dbc92d11de2 Comment out the line pointing to the Lesstif source
Gerd Moellmann <gerd@gnu.org>
parents: 32812
diff changeset
6 #dir /gd/gnu/lesstif-0.89.9/lib/Xm
15536
fb218a8bd186 Add `dir ../lwlib'.
Richard M. Stallman <rms@gnu.org>
parents: 13551
diff changeset
7
20672
0ef14112e9b3 Make GDB not handle SIGINT.
Karl Heuer <kwzh@gnu.org>
parents: 20582
diff changeset
8 # Don't enter GDB when user types C-g to quit.
0ef14112e9b3 Make GDB not handle SIGINT.
Karl Heuer <kwzh@gnu.org>
parents: 20582
diff changeset
9 # This has one unfortunate effect: you can't type C-c
0ef14112e9b3 Make GDB not handle SIGINT.
Karl Heuer <kwzh@gnu.org>
parents: 20582
diff changeset
10 # at the GDB to stop Emacs, when using X.
0ef14112e9b3 Make GDB not handle SIGINT.
Karl Heuer <kwzh@gnu.org>
parents: 20582
diff changeset
11 # However, C-z works just as well in that case.
0ef14112e9b3 Make GDB not handle SIGINT.
Karl Heuer <kwzh@gnu.org>
parents: 20582
diff changeset
12 handle 2 noprint pass
0ef14112e9b3 Make GDB not handle SIGINT.
Karl Heuer <kwzh@gnu.org>
parents: 20582
diff changeset
13
30636
88e0ba67d3bc (xhashtable): New command.
Gerd Moellmann <gerd@gnu.org>
parents: 27290
diff changeset
14 # Don't pass SIGALRM to Emacs. This makes problems when
88e0ba67d3bc (xhashtable): New command.
Gerd Moellmann <gerd@gnu.org>
parents: 27290
diff changeset
15 # debugging.
88e0ba67d3bc (xhashtable): New command.
Gerd Moellmann <gerd@gnu.org>
parents: 27290
diff changeset
16 handle SIGALRM ignore
88e0ba67d3bc (xhashtable): New command.
Gerd Moellmann <gerd@gnu.org>
parents: 27290
diff changeset
17
20672
0ef14112e9b3 Make GDB not handle SIGINT.
Karl Heuer <kwzh@gnu.org>
parents: 20582
diff changeset
18 # Set up a mask to use.
12278
6882fe187fa9 Use long, not EMACS_INT.
Richard M. Stallman <rms@gnu.org>
parents: 12248
diff changeset
19 # This should be EMACS_INT, but in some cases that is a macro.
6882fe187fa9 Use long, not EMACS_INT.
Richard M. Stallman <rms@gnu.org>
parents: 12248
diff changeset
20 # long ought to work in all cases right now.
6882fe187fa9 Use long, not EMACS_INT.
Richard M. Stallman <rms@gnu.org>
parents: 12248
diff changeset
21 set $valmask = ((long)1 << gdb_valbits) - 1
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
22 set $nonvalbits = gdb_emacs_intbits - gdb_valbits
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
23
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
24 # Set up something to print out s-expressions.
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25 define pr
6534
19aacadabdc0 (pr): Use debug_print.
Richard M. Stallman <rms@gnu.org>
parents: 5403
diff changeset
26 set debug_print ($)
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28 document pr
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
29 Print the emacs s-expression which is $.
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
30 Works only when an inferior emacs is executing.
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
31 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
32
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33 define xtype
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
34 output (enum Lisp_Type) (($ >> gdb_valbits) & 0x7)
10299
0de933eb95a2 Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents: 8310
diff changeset
35 echo \n
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
36 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)
999
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
37 echo \n
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
39 document xtype
7962
05260d3b988d Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 7961
diff changeset
40 Print the type of $, assuming it is an Emacs Lisp value.
10299
0de933eb95a2 Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents: 8310
diff changeset
41 If the first type printed is Lisp_Vector or Lisp_Misc,
0de933eb95a2 Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents: 8310
diff changeset
42 the second line gives the more precise type.
0de933eb95a2 Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents: 8310
diff changeset
43 Otherwise the second line doesn't mean anything.
0de933eb95a2 Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents: 8310
diff changeset
44 end
0de933eb95a2 Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents: 8310
diff changeset
45
0de933eb95a2 Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents: 8310
diff changeset
46 define xvectype
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
47 set $size = ((struct Lisp_Vector *) (($ & $valmask) | gdb_data_seg_bits))->size
10299
0de933eb95a2 Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents: 8310
diff changeset
48 output (enum pvec_type) (($size & PVEC_FLAG) ? $size & PVEC_TYPE_MASK : 0)
0de933eb95a2 Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents: 8310
diff changeset
49 echo \n
0de933eb95a2 Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents: 8310
diff changeset
50 end
0de933eb95a2 Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents: 8310
diff changeset
51 document xvectype
0de933eb95a2 Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents: 8310
diff changeset
52 Print the vector subtype of $, assuming it is a vector or pseudovector.
0de933eb95a2 Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents: 8310
diff changeset
53 end
0de933eb95a2 Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents: 8310
diff changeset
54
0de933eb95a2 Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents: 8310
diff changeset
55 define xmisctype
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
56 output (enum Lisp_Misc_Type) (((struct Lisp_Free *) (($ & $valmask) | gdb_data_seg_bits))->type)
10299
0de933eb95a2 Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents: 8310
diff changeset
57 echo \n
0de933eb95a2 Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents: 8310
diff changeset
58 end
0de933eb95a2 Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents: 8310
diff changeset
59 document xmisctype
0de933eb95a2 Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents: 8310
diff changeset
60 Print the specific type of $, assuming it is some misc type.
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
61 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
62
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63 define xint
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
64 print (($ & $valmask) << $nonvalbits) >> $nonvalbits
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
65 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
66 document xint
7962
05260d3b988d Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 7961
diff changeset
67 Print $, assuming it is an Emacs Lisp integer. This gets the sign right.
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
68 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
69
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
70 define xptr
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
71 print (void *) (($ & $valmask) | gdb_data_seg_bits)
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
72 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
73 document xptr
7962
05260d3b988d Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 7961
diff changeset
74 Print the pointer portion of $, assuming it is an Emacs Lisp value.
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
75 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
76
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
77 define xmarker
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
78 print (struct Lisp_Marker *) (($ & $valmask) | gdb_data_seg_bits)
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
79 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
80 document xmarker
7962
05260d3b988d Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 7961
diff changeset
81 Print $ as a marker pointer, assuming it is an Emacs Lisp marker value.
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
82 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
83
10483
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
84 define xoverlay
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
85 print (struct Lisp_Overlay *) (($ & $valmask) | gdb_data_seg_bits)
10483
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
86 end
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
87 document xoverlay
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
88 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>
parents: 10337
diff changeset
89 end
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
90
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
91 define xmiscfree
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
92 print (struct Lisp_Free *) (($ & $valmask) | gdb_data_seg_bits)
10483
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
93 end
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
94 document xmiscfree
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
95 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>
parents: 10337
diff changeset
96 end
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
97
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
98 define xintfwd
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
99 print (struct Lisp_Intfwd *) (($ & $valmask) | gdb_data_seg_bits)
10483
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
100 end
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
101 document xintfwd
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
102 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>
parents: 10337
diff changeset
103 end
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
104
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
105 define xboolfwd
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
106 print (struct Lisp_Boolfwd *) (($ & $valmask) | gdb_data_seg_bits)
10483
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
107 end
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
108 document xboolfwd
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
109 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>
parents: 10337
diff changeset
110 end
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
111
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
112 define xobjfwd
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
113 print (struct Lisp_Objfwd *) (($ & $valmask) | gdb_data_seg_bits)
10483
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
114 end
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
115 document xobjfwd
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
116 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>
parents: 10337
diff changeset
117 end
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
118
10495
70bd087c47a9 (xbufobjfwd, xbuflocal, xwinconfig):
Karl Heuer <kwzh@gnu.org>
parents: 10483
diff changeset
119 define xbufobjfwd
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
120 print (struct Lisp_Buffer_Objfwd *) (($ & $valmask) | gdb_data_seg_bits)
10483
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
121 end
10495
70bd087c47a9 (xbufobjfwd, xbuflocal, xwinconfig):
Karl Heuer <kwzh@gnu.org>
parents: 10483
diff changeset
122 document xbufobjfwd
10483
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
123 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>
parents: 10337
diff changeset
124 end
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
125
11006
2aa4135eee50 (xkbobjfwd): Renamed from xdispobjfwd.
Karl Heuer <kwzh@gnu.org>
parents: 10582
diff changeset
126 define xkbobjfwd
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
127 print (struct Lisp_Kboard_Objfwd *) (($ & $valmask) | gdb_data_seg_bits)
10582
6063c1f07723 (xdispobjfwd): New macro.
Karl Heuer <kwzh@gnu.org>
parents: 10495
diff changeset
128 end
11006
2aa4135eee50 (xkbobjfwd): Renamed from xdispobjfwd.
Karl Heuer <kwzh@gnu.org>
parents: 10582
diff changeset
129 document xkbobjfwd
2aa4135eee50 (xkbobjfwd): Renamed from xdispobjfwd.
Karl Heuer <kwzh@gnu.org>
parents: 10582
diff changeset
130 Print $ as a kboard-local object forwarding pointer, assuming it is an Emacs Lisp Misc value.
10582
6063c1f07723 (xdispobjfwd): New macro.
Karl Heuer <kwzh@gnu.org>
parents: 10495
diff changeset
131 end
6063c1f07723 (xdispobjfwd): New macro.
Karl Heuer <kwzh@gnu.org>
parents: 10495
diff changeset
132
10495
70bd087c47a9 (xbufobjfwd, xbuflocal, xwinconfig):
Karl Heuer <kwzh@gnu.org>
parents: 10483
diff changeset
133 define xbuflocal
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
134 print (struct Lisp_Buffer_Local_Value *) (($ & $valmask) | gdb_data_seg_bits)
10483
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
135 end
10495
70bd087c47a9 (xbufobjfwd, xbuflocal, xwinconfig):
Karl Heuer <kwzh@gnu.org>
parents: 10483
diff changeset
136 document xbuflocal
10483
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
137 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>
parents: 10337
diff changeset
138 end
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
139
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
140 define xsymbol
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
141 print (struct Lisp_Symbol *) ((((int) $) & $valmask) | gdb_data_seg_bits)
27290
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
142 output (char*)$->name->data
999
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
143 echo \n
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
144 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
145 document xsymbol
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
146 Print the name and address of the symbol $.
7962
05260d3b988d Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 7961
diff changeset
147 This command assumes that $ is an Emacs Lisp symbol value.
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
148 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
149
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
150 define xstring
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
151 print (struct Lisp_String *) (($ & $valmask) | gdb_data_seg_bits)
22012
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
152 output ($->size > 1000) ? 0 : ($->data[0])@($->size_byte < 0 ? $->size : $->size_byte)
999
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
153 echo \n
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
154 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
155 document xstring
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
156 Print the contents and address of the string $.
7962
05260d3b988d Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 7961
diff changeset
157 This command assumes that $ is an Emacs Lisp string value.
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
158 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
159
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
160 define xvector
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
161 print (struct Lisp_Vector *) (($ & $valmask) | gdb_data_seg_bits)
7961
f3e1a5c7bba1 (xsymbol): Cast $ to int.
Richard M. Stallman <rms@gnu.org>
parents: 6534
diff changeset
162 output ($->size > 50) ? 0 : ($->contents[0])@($->size)
999
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
163 echo \n
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
164 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
165 document xvector
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
166 Print the contents and address of the vector $.
7962
05260d3b988d Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 7961
diff changeset
167 This command assumes that $ is an Emacs Lisp vector value.
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
168 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
169
22012
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
170 define xprocess
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
171 print (struct Lisp_Process *) (($ & $valmask) | gdb_data_seg_bits)
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
172 output *$
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
173 echo \n
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
174 end
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
175 document xprocess
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
176 Print the address of the struct Lisp_process which the Lisp_Object $ points to.
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
177 end
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
178
1113
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 1069
diff changeset
179 define xframe
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
180 print (struct frame *) (($ & $valmask) | gdb_data_seg_bits)
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
181 end
1113
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 1069
diff changeset
182 document xframe
7962
05260d3b988d Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 7961
diff changeset
183 Print $ as a frame pointer, assuming it is an Emacs Lisp frame value.
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
184 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
185
22012
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
186 define xcompiled
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
187 print (struct Lisp_Vector *) (($ & $valmask) | gdb_data_seg_bits)
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
188 output ($->contents[0])@($->size & 0xff)
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
189 end
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
190 document xcompiled
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
191 Print $ as a compiled function pointer, assuming it is an Emacs Lisp compiled value.
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
192 end
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
193
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
194 define xwindow
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
195 print (struct window *) (($ & $valmask) | gdb_data_seg_bits)
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
196 printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
197 end
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
198 document xwindow
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
199 Print $ as a window pointer, assuming it is an Emacs Lisp window value.
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
200 Print the window's position as "WIDTHxHEIGHT+LEFT+TOP".
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
201 end
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
202
10495
70bd087c47a9 (xbufobjfwd, xbuflocal, xwinconfig):
Karl Heuer <kwzh@gnu.org>
parents: 10483
diff changeset
203 define xwinconfig
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
204 print (struct save_window_data *) (($ & $valmask) | gdb_data_seg_bits)
10483
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
205 end
10495
70bd087c47a9 (xbufobjfwd, xbuflocal, xwinconfig):
Karl Heuer <kwzh@gnu.org>
parents: 10483
diff changeset
206 document xwinconfig
10483
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
207 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>
parents: 10337
diff changeset
208 end
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
209
22012
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
210 define xsubr
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
211 print (struct Lisp_Subr *) (($ & $valmask) | gdb_data_seg_bits)
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
212 output *$
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
213 echo \n
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
214 end
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
215 document xsubr
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
216 Print the address of the subr which the Lisp_Object $ points to.
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
217 end
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
218
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
219 define xchartable
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
220 print (struct Lisp_Char_Table *) (($ & $valmask) | gdb_data_seg_bits)
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
221 printf "Purpose: "
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
222 output (char*)&((struct Lisp_Symbol *) ((((int) $->purpose) & $valmask) | gdb_data_seg_bits))->name->data
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
223 printf " %d extra slots", ($->size & 0x1ff) - 388
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
224 echo \n
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
225 end
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
226 document xchartable
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
227 Print the address of the char-table $, and its purpose.
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
228 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>
parents: 10337
diff changeset
229 end
22012
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
230
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
231 define xboolvector
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
232 print (struct Lisp_Bool_Vector *) (($ & $valmask) | gdb_data_seg_bits)
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
233 output ($->size > 256) ? 0 : ($->data[0])@(($->size + 7)/ 8)
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
234 echo \n
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
235 end
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
236 document xboolvector
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
237 Print the contents and address of the bool-vector $.
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
238 This command assumes that $ is an Emacs Lisp bool-vector value.
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
239 end
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
240
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
241 define xbuffer
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
242 print (struct buffer *) (($ & $valmask) | gdb_data_seg_bits)
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
243 output &((struct Lisp_String *) ((($->name) & $valmask) | gdb_data_seg_bits))->data
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
244 echo \n
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
245 end
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
246 document xbuffer
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
247 Set $ as a buffer pointer, assuming it is an Emacs Lisp buffer value.
4379a41b6f2e (xstring): Handle unibyte strings.
Richard M. Stallman <rms@gnu.org>
parents: 20672
diff changeset
248 Print the name of the buffer.
10483
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
249 end
727cd2061e2a (xboolfwd, xbuffer_local_value, xbuffer_objfwd, xcompiled, xintfwd, xmiscfree,
Karl Heuer <kwzh@gnu.org>
parents: 10337
diff changeset
250
30636
88e0ba67d3bc (xhashtable): New command.
Gerd Moellmann <gerd@gnu.org>
parents: 27290
diff changeset
251 define xhashtable
88e0ba67d3bc (xhashtable): New command.
Gerd Moellmann <gerd@gnu.org>
parents: 27290
diff changeset
252 print (struct Lisp_Hash_Table *) (($ & $valmask) | gdb_data_seg_bits)
88e0ba67d3bc (xhashtable): New command.
Gerd Moellmann <gerd@gnu.org>
parents: 27290
diff changeset
253 end
88e0ba67d3bc (xhashtable): New command.
Gerd Moellmann <gerd@gnu.org>
parents: 27290
diff changeset
254 document xhashtable
88e0ba67d3bc (xhashtable): New command.
Gerd Moellmann <gerd@gnu.org>
parents: 27290
diff changeset
255 Set $ as a hash table pointer, assuming it is an Emacs Lisp hash table value.
88e0ba67d3bc (xhashtable): New command.
Gerd Moellmann <gerd@gnu.org>
parents: 27290
diff changeset
256 end
88e0ba67d3bc (xhashtable): New command.
Gerd Moellmann <gerd@gnu.org>
parents: 27290
diff changeset
257
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
258 define xcons
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
259 print (struct Lisp_Cons *) (($ & $valmask) | gdb_data_seg_bits)
18522
c572c073c982 (xcons): Print car and cdr in hex.
Richard M. Stallman <rms@gnu.org>
parents: 15536
diff changeset
260 output/x *$
999
d8d503897aa5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 949
diff changeset
261 echo \n
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
262 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
263 document xcons
7962
05260d3b988d Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 7961
diff changeset
264 Print the contents of $, assuming it is an Emacs Lisp cons.
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
265 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
266
18522
c572c073c982 (xcons): Print car and cdr in hex.
Richard M. Stallman <rms@gnu.org>
parents: 15536
diff changeset
267 define nextcons
c572c073c982 (xcons): Print car and cdr in hex.
Richard M. Stallman <rms@gnu.org>
parents: 15536
diff changeset
268 p $.cdr
c572c073c982 (xcons): Print car and cdr in hex.
Richard M. Stallman <rms@gnu.org>
parents: 15536
diff changeset
269 xcons
c572c073c982 (xcons): Print car and cdr in hex.
Richard M. Stallman <rms@gnu.org>
parents: 15536
diff changeset
270 end
c572c073c982 (xcons): Print car and cdr in hex.
Richard M. Stallman <rms@gnu.org>
parents: 15536
diff changeset
271 document nextcons
c572c073c982 (xcons): Print car and cdr in hex.
Richard M. Stallman <rms@gnu.org>
parents: 15536
diff changeset
272 Print the contents of the next cell in a list.
c572c073c982 (xcons): Print car and cdr in hex.
Richard M. Stallman <rms@gnu.org>
parents: 15536
diff changeset
273 This assumes that the last thing you printed was a cons cell contents
c572c073c982 (xcons): Print car and cdr in hex.
Richard M. Stallman <rms@gnu.org>
parents: 15536
diff changeset
274 (type struct Lisp_Cons) or a pointer to one.
c572c073c982 (xcons): Print car and cdr in hex.
Richard M. Stallman <rms@gnu.org>
parents: 15536
diff changeset
275 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
276 define xcar
18835
8b32c6fe8728 (xcar, xcdr): Print with /x.
Richard M. Stallman <rms@gnu.org>
parents: 18522
diff changeset
277 print/x ((($ >> gdb_valbits) & 0xf) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & $valmask) | gdb_data_seg_bits))->car : 0)
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
278 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
279 document xcar
7962
05260d3b988d Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 7961
diff changeset
280 Print the car of $, assuming it is an Emacs Lisp pair.
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
281 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
282
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
283 define xcdr
18835
8b32c6fe8728 (xcar, xcdr): Print with /x.
Richard M. Stallman <rms@gnu.org>
parents: 18522
diff changeset
284 print/x ((($ >> gdb_valbits) & 0xf) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & $valmask) | gdb_data_seg_bits))->cdr : 0)
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
285 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
286 document xcdr
7962
05260d3b988d Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 7961
diff changeset
287 Print the cdr of $, assuming it is an Emacs Lisp pair.
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
288 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
289
4267
aabcab2eab73 Add size to geometry spec.
Jim Blandy <jimb@redhat.com>
parents: 2162
diff changeset
290 define xfloat
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
291 print ((struct Lisp_Float *) (($ & $valmask) | gdb_data_seg_bits))->data
4267
aabcab2eab73 Add size to geometry spec.
Jim Blandy <jimb@redhat.com>
parents: 2162
diff changeset
292 end
aabcab2eab73 Add size to geometry spec.
Jim Blandy <jimb@redhat.com>
parents: 2162
diff changeset
293 document xfloat
aabcab2eab73 Add size to geometry spec.
Jim Blandy <jimb@redhat.com>
parents: 2162
diff changeset
294 Print $ assuming it is a lisp floating-point number.
aabcab2eab73 Add size to geometry spec.
Jim Blandy <jimb@redhat.com>
parents: 2162
diff changeset
295 end
aabcab2eab73 Add size to geometry spec.
Jim Blandy <jimb@redhat.com>
parents: 2162
diff changeset
296
1789
2c65d1a8af09 * .gdbinit: Add "-geometry +0+0" to default args.
Jim Blandy <jimb@redhat.com>
parents: 1551
diff changeset
297 define xscrollbar
11872
a28bd38b2ff3 gdb_lisp_params to get storage layout info.
Karl Heuer <kwzh@gnu.org>
parents: 11006
diff changeset
298 print (struct scrollbar *) (($ & $valmask) | gdb_data_seg_bits)
1789
2c65d1a8af09 * .gdbinit: Add "-geometry +0+0" to default args.
Jim Blandy <jimb@redhat.com>
parents: 1551
diff changeset
299 output *$
2c65d1a8af09 * .gdbinit: Add "-geometry +0+0" to default args.
Jim Blandy <jimb@redhat.com>
parents: 1551
diff changeset
300 echo \n
2c65d1a8af09 * .gdbinit: Add "-geometry +0+0" to default args.
Jim Blandy <jimb@redhat.com>
parents: 1551
diff changeset
301 end
4268
0795ced6013f (xscrollbar): Fix typo specifying doc string.
Richard M. Stallman <rms@gnu.org>
parents: 4267
diff changeset
302 document xscrollbar
1789
2c65d1a8af09 * .gdbinit: Add "-geometry +0+0" to default args.
Jim Blandy <jimb@redhat.com>
parents: 1551
diff changeset
303 Print $ as a scrollbar pointer.
2c65d1a8af09 * .gdbinit: Add "-geometry +0+0" to default args.
Jim Blandy <jimb@redhat.com>
parents: 1551
diff changeset
304 end
2c65d1a8af09 * .gdbinit: Add "-geometry +0+0" to default args.
Jim Blandy <jimb@redhat.com>
parents: 1551
diff changeset
305
27290
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
306 define xprintsym
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
307 set $sym = (struct Lisp_Symbol *) ((((int) $arg0) & $valmask) | gdb_data_seg_bits)
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
308 output (char*)$sym->name->data
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
309 echo \n
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
310 end
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
311 document xprintsym
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
312 Print argument as a symbol.
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
313 end
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
314
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
315 define xbacktrace
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
316 set $bt = backtrace_list
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
317 while $bt
32812
c49b460bb280 (xbacktrace): Handle case that $bt->function isn't
Gerd Moellmann <gerd@gnu.org>
parents: 31960
diff changeset
318 set $type = (enum Lisp_Type) ((*$bt->function >> gdb_valbits) & 0x7)
c49b460bb280 (xbacktrace): Handle case that $bt->function isn't
Gerd Moellmann <gerd@gnu.org>
parents: 31960
diff changeset
319 if $type == Lisp_Symbol
c49b460bb280 (xbacktrace): Handle case that $bt->function isn't
Gerd Moellmann <gerd@gnu.org>
parents: 31960
diff changeset
320 xprintsym *$bt->function
c49b460bb280 (xbacktrace): Handle case that $bt->function isn't
Gerd Moellmann <gerd@gnu.org>
parents: 31960
diff changeset
321 else
c49b460bb280 (xbacktrace): Handle case that $bt->function isn't
Gerd Moellmann <gerd@gnu.org>
parents: 31960
diff changeset
322 printf "0x%x ", *$bt->function
c49b460bb280 (xbacktrace): Handle case that $bt->function isn't
Gerd Moellmann <gerd@gnu.org>
parents: 31960
diff changeset
323 if $type == Lisp_Vectorlike
c49b460bb280 (xbacktrace): Handle case that $bt->function isn't
Gerd Moellmann <gerd@gnu.org>
parents: 31960
diff changeset
324 set $size = ((struct Lisp_Vector *) ((*$bt->function & $valmask) | gdb_data_seg_bits))->size
c49b460bb280 (xbacktrace): Handle case that $bt->function isn't
Gerd Moellmann <gerd@gnu.org>
parents: 31960
diff changeset
325 output (enum pvec_type) (($size & PVEC_FLAG) ? $size & PVEC_TYPE_MASK : 0)
c49b460bb280 (xbacktrace): Handle case that $bt->function isn't
Gerd Moellmann <gerd@gnu.org>
parents: 31960
diff changeset
326 else
c49b460bb280 (xbacktrace): Handle case that $bt->function isn't
Gerd Moellmann <gerd@gnu.org>
parents: 31960
diff changeset
327 printf "Lisp type %d", $type
c49b460bb280 (xbacktrace): Handle case that $bt->function isn't
Gerd Moellmann <gerd@gnu.org>
parents: 31960
diff changeset
328 end
c49b460bb280 (xbacktrace): Handle case that $bt->function isn't
Gerd Moellmann <gerd@gnu.org>
parents: 31960
diff changeset
329 echo \n
c49b460bb280 (xbacktrace): Handle case that $bt->function isn't
Gerd Moellmann <gerd@gnu.org>
parents: 31960
diff changeset
330 end
27290
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
331 set $bt = $bt->next
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
332 end
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
333 end
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
334 document xbacktrace
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
335 Print a backtrace of Lisp function calls from backtrace_list.
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
336 Set a breakpoint at Fsignal and call this to see from where
32812
c49b460bb280 (xbacktrace): Handle case that $bt->function isn't
Gerd Moellmann <gerd@gnu.org>
parents: 31960
diff changeset
337 an error was signaled.
27290
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
338 end
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
339
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
340 define xreload
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
341 set $valmask = ((long)1 << gdb_valbits) - 1
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
342 set $nonvalbits = gdb_emacs_intbits - gdb_valbits
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
343 end
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
344 document xreload
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
345 When starting Emacs a second time in the same gdb session under
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
346 FreeBSD 2.2.5, gdb 4.13, $valmask and $nonvalbits have lost
31960
eb2d3d3a8eb5 (xreload): Note its need on GNU/Linux.
Dave Love <fx@gnu.org>
parents: 30636
diff changeset
347 their values. (The same happens on GNU/Linux with gdb 5.0.)
eb2d3d3a8eb5 (xreload): Note its need on GNU/Linux.
Dave Love <fx@gnu.org>
parents: 30636
diff changeset
348 This function reloads them.
27290
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
349 end
c26a9f95a880 Adapt to new strings.
Gerd Moellmann <gerd@gnu.org>
parents: 22012
diff changeset
350
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
351 set print pretty on
4267
aabcab2eab73 Add size to geometry spec.
Jim Blandy <jimb@redhat.com>
parents: 2162
diff changeset
352 set print sevenbit-strings
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
353
732
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
354 show environment DISPLAY
4487
177aaa70734d Don't put -q in args.
Richard M. Stallman <rms@gnu.org>
parents: 4268
diff changeset
355 show environment TERM
177aaa70734d Don't put -q in args.
Richard M. Stallman <rms@gnu.org>
parents: 4268
diff changeset
356 set args -geometry 80x40+0+0
732
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
357
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
358 # Don't let abort actually run, as it will make
2162
1dcc4e12b8dd Doc fix.
Jim Blandy <jimb@redhat.com>
parents: 1943
diff changeset
359 # stdio stop working and therefore the `pr' command above as well.
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
360 break abort
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
361
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
362 # If we are running in synchronous mode, we want a chance to look around
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
363 # before Emacs exits. Perhaps we should put the break somewhere else
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
364 # instead...
8310
def3ab3a6f01 Set the breakpoint in x_error_quitter instead of _XPrintDefaultError.
Richard M. Stallman <rms@gnu.org>
parents: 7962
diff changeset
365 break x_error_quitter