Mercurial > emacs
annotate src/.gdbinit @ 10318:b18a4ff30816
(tex-mode): \begin at start of file implies Latex.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 02 Jan 1995 23:07:36 +0000 |
parents | 0de933eb95a2 |
children | a76a89bb6c57 |
rev | line source |
---|---|
567 | 1 # Set up something to print out s-expressions. |
2 define pr | |
6534 | 3 set debug_print ($) |
567 | 4 echo \n |
5 end | |
6 document pr | |
7 Print the emacs s-expression which is $. | |
8 Works only when an inferior emacs is executing. | |
9 end | |
10 | |
1113 | 11 # Set this to the same thing as the DATA_SEG_BITS macro in your |
12 # machine-description files. | |
13 set $data_seg_bits = 0 | |
14 | |
1551 | 15 define mips |
16 set $data_seg_bits = 0x10000000 | |
17 end | |
18 document mips | |
19 Set up the xfoo macros to deal with the MIPS processor. | |
20 Specifically, this sets $data_seg_bits to the right thing. | |
21 end | |
22 | |
567 | 23 define xtype |
10299
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
24 output (enum Lisp_Type) (($ >> 28) & 0x7) |
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
25 echo \n |
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
26 output ((($ >> 28) & 0x7) == Lisp_Misc ? (enum Lisp_Misc_Type) (((struct Lisp_Free *) (($ & 0x0fffffff) | $data_seg_bits))->type) : (($ >> 28) & 0x7) == Lisp_Vectorlike ? ($size = ((struct Lisp_Vector *) (($ & 0x0fffffff) | $data_seg_bits))->size, (enum pvec_type) (($size & PVEC_FLAG) ? $size & PVEC_TYPE_MASK : 0)) : 0) |
999 | 27 echo \n |
567 | 28 end |
638 | 29 document xtype |
7962 | 30 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
|
31 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
|
32 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
|
33 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
|
34 end |
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
35 |
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
36 define xvectype |
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
37 set $size = ((struct Lisp_Vector *) (($ & 0x0fffffff) | $data_seg_bits))->size |
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
38 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
|
39 echo \n |
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
40 end |
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
41 document xvectype |
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
42 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
|
43 end |
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
44 |
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
45 define xmisctype |
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
46 output (enum Lisp_Misc_Type) (((struct Lisp_Free *) (($ & 0x0fffffff) | $data_seg_bits))->type) |
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
47 echo \n |
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
48 end |
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
49 document xmisctype |
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
50 Print the specific type of $, assuming it is some misc type. |
638 | 51 end |
567 | 52 |
53 define xint | |
10299
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
54 print (($ & 0x00ffffff) << 4) >> 4 |
567 | 55 end |
638 | 56 document xint |
7962 | 57 Print $, assuming it is an Emacs Lisp integer. This gets the sign right. |
638 | 58 end |
567 | 59 |
60 define xptr | |
10299
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
61 print (void *) (($ & 0x0fffffff) | $data_seg_bits) |
567 | 62 end |
638 | 63 document xptr |
7962 | 64 Print the pointer portion of $, assuming it is an Emacs Lisp value. |
638 | 65 end |
567 | 66 |
67 define xwindow | |
10299
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
68 print (struct window *) (($ & 0x0fffffff) | $data_seg_bits) |
999 | 69 printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top |
567 | 70 end |
638 | 71 document xwindow |
7962 | 72 Print $ as a window pointer, assuming it is an Emacs Lisp window value. |
999 | 73 Print the window's position as "WIDTHxHEIGHT+LEFT+TOP". |
638 | 74 end |
567 | 75 |
76 define xmarker | |
10299
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
77 print (struct Lisp_Marker *) (($ & 0x0fffffff) | $data_seg_bits) |
567 | 78 end |
638 | 79 document xmarker |
7962 | 80 Print $ as a marker pointer, assuming it is an Emacs Lisp marker value. |
638 | 81 end |
567 | 82 |
83 define xbuffer | |
10299
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
84 print (struct buffer *) (($ & 0x0fffffff) | $data_seg_bits) |
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
85 output &((struct Lisp_String *) ((($->name) & 0x0fffffff) | $data_seg_bits))->data |
999 | 86 echo \n |
567 | 87 end |
638 | 88 document xbuffer |
7962 | 89 Set $ as a buffer pointer, assuming it is an Emacs Lisp buffer value. |
727 | 90 Print the name of the buffer. |
638 | 91 end |
567 | 92 |
93 define xsymbol | |
10299
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
94 print (struct Lisp_Symbol *) ((((int) $) & 0x0fffffff) | $data_seg_bits) |
999 | 95 output &$->name->data |
96 echo \n | |
567 | 97 end |
638 | 98 document xsymbol |
99 Print the name and address of the symbol $. | |
7962 | 100 This command assumes that $ is an Emacs Lisp symbol value. |
638 | 101 end |
567 | 102 |
103 define xstring | |
10299
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
104 print (struct Lisp_String *) (($ & 0x0fffffff) | $data_seg_bits) |
7961
f3e1a5c7bba1
(xsymbol): Cast $ to int.
Richard M. Stallman <rms@gnu.org>
parents:
6534
diff
changeset
|
105 output ($->size > 1000) ? 0 : ($->data[0])@($->size) |
999 | 106 echo \n |
567 | 107 end |
108 document xstring | |
638 | 109 Print the contents and address of the string $. |
7962 | 110 This command assumes that $ is an Emacs Lisp string value. |
567 | 111 end |
112 | |
113 define xvector | |
10299
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
114 print (struct Lisp_Vector *) (($ & 0x0fffffff) | $data_seg_bits) |
7961
f3e1a5c7bba1
(xsymbol): Cast $ to int.
Richard M. Stallman <rms@gnu.org>
parents:
6534
diff
changeset
|
115 output ($->size > 50) ? 0 : ($->contents[0])@($->size) |
999 | 116 echo \n |
567 | 117 end |
118 document xvector | |
638 | 119 Print the contents and address of the vector $. |
7962 | 120 This command assumes that $ is an Emacs Lisp vector value. |
567 | 121 end |
122 | |
1113 | 123 define xframe |
10299
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
124 print (struct frame *) (($ & 0x0fffffff) | $data_seg_bits) |
567 | 125 end |
1113 | 126 document xframe |
7962 | 127 Print $ as a frame pointer, assuming it is an Emacs Lisp frame value. |
638 | 128 end |
567 | 129 |
130 define xcons | |
10299
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
131 print (struct Lisp_Cons *) (($ & 0x0fffffff) | $data_seg_bits) |
1069 | 132 output *$ |
999 | 133 echo \n |
567 | 134 end |
638 | 135 document xcons |
7962 | 136 Print the contents of $, assuming it is an Emacs Lisp cons. |
638 | 137 end |
567 | 138 |
139 define xcar | |
10299
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
140 print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & 0x0fffffff) | $data_seg_bits))->car : 0) |
567 | 141 end |
638 | 142 document xcar |
7962 | 143 Print the car of $, assuming it is an Emacs Lisp pair. |
638 | 144 end |
567 | 145 |
146 define xcdr | |
10299
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
147 print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & 0x0fffffff) | $data_seg_bits))->cdr : 0) |
567 | 148 end |
638 | 149 document xcdr |
7962 | 150 Print the cdr of $, assuming it is an Emacs Lisp pair. |
638 | 151 end |
567 | 152 |
1113 | 153 define xsubr |
10299
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
154 print (struct Lisp_Subr *) (($ & 0x0fffffff) | $data_seg_bits) |
1113 | 155 output *$ |
156 echo \n | |
157 end | |
158 document xsubr | |
159 Print the address of the subr which the Lisp_Object $ points to. | |
160 end | |
161 | |
1943
80482f2d54bf
* .gdbinit (xprocess): New command.
Jim Blandy <jimb@redhat.com>
parents:
1789
diff
changeset
|
162 define xprocess |
10299
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
163 print (struct Lisp_Process *) (($ & 0x0fffffff) | $data_seg_bits) |
1943
80482f2d54bf
* .gdbinit (xprocess): New command.
Jim Blandy <jimb@redhat.com>
parents:
1789
diff
changeset
|
164 output *$ |
80482f2d54bf
* .gdbinit (xprocess): New command.
Jim Blandy <jimb@redhat.com>
parents:
1789
diff
changeset
|
165 echo \n |
80482f2d54bf
* .gdbinit (xprocess): New command.
Jim Blandy <jimb@redhat.com>
parents:
1789
diff
changeset
|
166 end |
80482f2d54bf
* .gdbinit (xprocess): New command.
Jim Blandy <jimb@redhat.com>
parents:
1789
diff
changeset
|
167 document xprocess |
80482f2d54bf
* .gdbinit (xprocess): New command.
Jim Blandy <jimb@redhat.com>
parents:
1789
diff
changeset
|
168 Print the address of the struct Lisp_process which the Lisp_Object $ points to. |
80482f2d54bf
* .gdbinit (xprocess): New command.
Jim Blandy <jimb@redhat.com>
parents:
1789
diff
changeset
|
169 end |
80482f2d54bf
* .gdbinit (xprocess): New command.
Jim Blandy <jimb@redhat.com>
parents:
1789
diff
changeset
|
170 |
4267 | 171 define xfloat |
10299
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
172 print ((struct Lisp_Float *) (($ & 0x0fffffff) | $data_seg_bits))->data |
4267 | 173 end |
174 document xfloat | |
175 Print $ assuming it is a lisp floating-point number. | |
176 end | |
177 | |
1789
2c65d1a8af09
* .gdbinit: Add "-geometry +0+0" to default args.
Jim Blandy <jimb@redhat.com>
parents:
1551
diff
changeset
|
178 define xscrollbar |
10299
0de933eb95a2
Adapt to new Lisp_Object format.
Richard M. Stallman <rms@gnu.org>
parents:
8310
diff
changeset
|
179 print (struct scrollbar *) (($ & 0x0fffffff) | $data_seg_bits) |
1789
2c65d1a8af09
* .gdbinit: Add "-geometry +0+0" to default args.
Jim Blandy <jimb@redhat.com>
parents:
1551
diff
changeset
|
180 output *$ |
2c65d1a8af09
* .gdbinit: Add "-geometry +0+0" to default args.
Jim Blandy <jimb@redhat.com>
parents:
1551
diff
changeset
|
181 echo \n |
2c65d1a8af09
* .gdbinit: Add "-geometry +0+0" to default args.
Jim Blandy <jimb@redhat.com>
parents:
1551
diff
changeset
|
182 end |
4268
0795ced6013f
(xscrollbar): Fix typo specifying doc string.
Richard M. Stallman <rms@gnu.org>
parents:
4267
diff
changeset
|
183 document xscrollbar |
1789
2c65d1a8af09
* .gdbinit: Add "-geometry +0+0" to default args.
Jim Blandy <jimb@redhat.com>
parents:
1551
diff
changeset
|
184 Print $ as a scrollbar pointer. |
2c65d1a8af09
* .gdbinit: Add "-geometry +0+0" to default args.
Jim Blandy <jimb@redhat.com>
parents:
1551
diff
changeset
|
185 end |
2c65d1a8af09
* .gdbinit: Add "-geometry +0+0" to default args.
Jim Blandy <jimb@redhat.com>
parents:
1551
diff
changeset
|
186 |
638 | 187 set print pretty on |
4267 | 188 set print sevenbit-strings |
567 | 189 |
732 | 190 show environment DISPLAY |
4487 | 191 show environment TERM |
192 set args -geometry 80x40+0+0 | |
732 | 193 |
567 | 194 # Don't let abort actually run, as it will make |
2162 | 195 # stdio stop working and therefore the `pr' command above as well. |
567 | 196 break abort |
197 | |
198 # If we are running in synchronous mode, we want a chance to look around | |
199 # before Emacs exits. Perhaps we should put the break somewhere else | |
200 # instead... | |
8310
def3ab3a6f01
Set the breakpoint in x_error_quitter instead of _XPrintDefaultError.
Richard M. Stallman <rms@gnu.org>
parents:
7962
diff
changeset
|
201 break x_error_quitter |
567 | 202 |
8310
def3ab3a6f01
Set the breakpoint in x_error_quitter instead of _XPrintDefaultError.
Richard M. Stallman <rms@gnu.org>
parents:
7962
diff
changeset
|
203 |