comparison src/.gdbinit @ 22012:4379a41b6f2e

(xstring): Handle unibyte strings. (xchartable, xboolvector): New commands.
author Richard M. Stallman <rms@gnu.org>
date Sun, 10 May 1998 01:13:11 +0000
parents 0ef14112e9b3
children c26a9f95a880
comparison
equal deleted inserted replaced
22011:e849b602b425 22012:4379a41b6f2e
67 end 67 end
68 document xptr 68 document xptr
69 Print the pointer portion of $, assuming it is an Emacs Lisp value. 69 Print the pointer portion of $, assuming it is an Emacs Lisp value.
70 end 70 end
71 71
72 define xmarker
73 print (struct Lisp_Marker *) (($ & $valmask) | gdb_data_seg_bits)
74 end
75 document xmarker
76 Print $ as a marker pointer, assuming it is an Emacs Lisp marker value.
77 end
78
79 define xoverlay
80 print (struct Lisp_Overlay *) (($ & $valmask) | gdb_data_seg_bits)
81 end
82 document xoverlay
83 Print $ as a overlay pointer, assuming it is an Emacs Lisp overlay value.
84 end
85
86 define xmiscfree
87 print (struct Lisp_Free *) (($ & $valmask) | gdb_data_seg_bits)
88 end
89 document xmiscfree
90 Print $ as a misc free-cell pointer, assuming it is an Emacs Lisp Misc value.
91 end
92
93 define xintfwd
94 print (struct Lisp_Intfwd *) (($ & $valmask) | gdb_data_seg_bits)
95 end
96 document xintfwd
97 Print $ as an integer forwarding pointer, assuming it is an Emacs Lisp Misc value.
98 end
99
100 define xboolfwd
101 print (struct Lisp_Boolfwd *) (($ & $valmask) | gdb_data_seg_bits)
102 end
103 document xboolfwd
104 Print $ as a boolean forwarding pointer, assuming it is an Emacs Lisp Misc value.
105 end
106
107 define xobjfwd
108 print (struct Lisp_Objfwd *) (($ & $valmask) | gdb_data_seg_bits)
109 end
110 document xobjfwd
111 Print $ as an object forwarding pointer, assuming it is an Emacs Lisp Misc value.
112 end
113
114 define xbufobjfwd
115 print (struct Lisp_Buffer_Objfwd *) (($ & $valmask) | gdb_data_seg_bits)
116 end
117 document xbufobjfwd
118 Print $ as a buffer-local object forwarding pointer, assuming it is an Emacs Lisp Misc value.
119 end
120
121 define xkbobjfwd
122 print (struct Lisp_Kboard_Objfwd *) (($ & $valmask) | gdb_data_seg_bits)
123 end
124 document xkbobjfwd
125 Print $ as a kboard-local object forwarding pointer, assuming it is an Emacs Lisp Misc value.
126 end
127
128 define xbuflocal
129 print (struct Lisp_Buffer_Local_Value *) (($ & $valmask) | gdb_data_seg_bits)
130 end
131 document xbuflocal
132 Print $ as a buffer-local-value pointer, assuming it is an Emacs Lisp Misc value.
133 end
134
135 define xsymbol
136 print (struct Lisp_Symbol *) ((((int) $) & $valmask) | gdb_data_seg_bits)
137 output (char*)&$->name->data
138 echo \n
139 end
140 document xsymbol
141 Print the name and address of the symbol $.
142 This command assumes that $ is an Emacs Lisp symbol value.
143 end
144
145 define xstring
146 print (struct Lisp_String *) (($ & $valmask) | gdb_data_seg_bits)
147 output ($->size > 1000) ? 0 : ($->data[0])@($->size_byte < 0 ? $->size : $->size_byte)
148 echo \n
149 end
150 document xstring
151 Print the contents and address of the string $.
152 This command assumes that $ is an Emacs Lisp string value.
153 end
154
155 define xvector
156 print (struct Lisp_Vector *) (($ & $valmask) | gdb_data_seg_bits)
157 output ($->size > 50) ? 0 : ($->contents[0])@($->size)
158 echo \n
159 end
160 document xvector
161 Print the contents and address of the vector $.
162 This command assumes that $ is an Emacs Lisp vector value.
163 end
164
165 define xprocess
166 print (struct Lisp_Process *) (($ & $valmask) | gdb_data_seg_bits)
167 output *$
168 echo \n
169 end
170 document xprocess
171 Print the address of the struct Lisp_process which the Lisp_Object $ points to.
172 end
173
174 define xframe
175 print (struct frame *) (($ & $valmask) | gdb_data_seg_bits)
176 end
177 document xframe
178 Print $ as a frame pointer, assuming it is an Emacs Lisp frame value.
179 end
180
181 define xcompiled
182 print (struct Lisp_Vector *) (($ & $valmask) | gdb_data_seg_bits)
183 output ($->contents[0])@($->size & 0xff)
184 end
185 document xcompiled
186 Print $ as a compiled function pointer, assuming it is an Emacs Lisp compiled value.
187 end
188
72 define xwindow 189 define xwindow
73 print (struct window *) (($ & $valmask) | gdb_data_seg_bits) 190 print (struct window *) (($ & $valmask) | gdb_data_seg_bits)
74 printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top 191 printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top
75 end 192 end
76 document xwindow 193 document xwindow
77 Print $ as a window pointer, assuming it is an Emacs Lisp window value. 194 Print $ as a window pointer, assuming it is an Emacs Lisp window value.
78 Print the window's position as "WIDTHxHEIGHT+LEFT+TOP". 195 Print the window's position as "WIDTHxHEIGHT+LEFT+TOP".
79 end 196 end
80 197
81 define xmarker 198 define xwinconfig
82 print (struct Lisp_Marker *) (($ & $valmask) | gdb_data_seg_bits) 199 print (struct save_window_data *) (($ & $valmask) | gdb_data_seg_bits)
83 end 200 end
84 document xmarker 201 document xwinconfig
85 Print $ as a marker pointer, assuming it is an Emacs Lisp marker value. 202 Print $ as a window configuration pointer, assuming it is an Emacs Lisp window configuration value.
86 end 203 end
87 204
88 define xoverlay 205 define xsubr
89 print (struct Lisp_Overlay *) (($ & $valmask) | gdb_data_seg_bits) 206 print (struct Lisp_Subr *) (($ & $valmask) | gdb_data_seg_bits)
90 end 207 output *$
91 document xoverlay 208 echo \n
92 Print $ as a overlay pointer, assuming it is an Emacs Lisp overlay value. 209 end
93 end 210 document xsubr
94 211 Print the address of the subr which the Lisp_Object $ points to.
95 define xmiscfree 212 end
96 print (struct Lisp_Free *) (($ & $valmask) | gdb_data_seg_bits) 213
97 end 214 define xchartable
98 document xmiscfree 215 print (struct Lisp_Char_Table *) (($ & $valmask) | gdb_data_seg_bits)
99 Print $ as a misc free-cell pointer, assuming it is an Emacs Lisp Misc value. 216 printf "Purpose: "
100 end 217 output (char*)&((struct Lisp_Symbol *) ((((int) $->purpose) & $valmask) | gdb_data_seg_bits))->name->data
101 218 printf " %d extra slots", ($->size & 0x1ff) - 388
102 define xintfwd 219 echo \n
103 print (struct Lisp_Intfwd *) (($ & $valmask) | gdb_data_seg_bits) 220 end
104 end 221 document xchartable
105 document xintfwd 222 Print the address of the char-table $, and its purpose.
106 Print $ as an integer forwarding pointer, assuming it is an Emacs Lisp Misc value. 223 This command assumes that $ is an Emacs Lisp char-table value.
107 end 224 end
108 225
109 define xboolfwd 226 define xboolvector
110 print (struct Lisp_Boolfwd *) (($ & $valmask) | gdb_data_seg_bits) 227 print (struct Lisp_Bool_Vector *) (($ & $valmask) | gdb_data_seg_bits)
111 end 228 output ($->size > 256) ? 0 : ($->data[0])@(($->size + 7)/ 8)
112 document xboolfwd 229 echo \n
113 Print $ as a boolean forwarding pointer, assuming it is an Emacs Lisp Misc value. 230 end
114 end 231 document xboolvector
115 232 Print the contents and address of the bool-vector $.
116 define xobjfwd 233 This command assumes that $ is an Emacs Lisp bool-vector value.
117 print (struct Lisp_Objfwd *) (($ & $valmask) | gdb_data_seg_bits)
118 end
119 document xobjfwd
120 Print $ as an object forwarding pointer, assuming it is an Emacs Lisp Misc value.
121 end
122
123 define xbufobjfwd
124 print (struct Lisp_Buffer_Objfwd *) (($ & $valmask) | gdb_data_seg_bits)
125 end
126 document xbufobjfwd
127 Print $ as a buffer-local object forwarding pointer, assuming it is an Emacs Lisp Misc value.
128 end
129
130 define xkbobjfwd
131 print (struct Lisp_Kboard_Objfwd *) (($ & $valmask) | gdb_data_seg_bits)
132 end
133 document xkbobjfwd
134 Print $ as a kboard-local object forwarding pointer, assuming it is an Emacs Lisp Misc value.
135 end
136
137 define xbuflocal
138 print (struct Lisp_Buffer_Local_Value *) (($ & $valmask) | gdb_data_seg_bits)
139 end
140 document xbuflocal
141 Print $ as a buffer-local-value pointer, assuming it is an Emacs Lisp Misc value.
142 end 234 end
143 235
144 define xbuffer 236 define xbuffer
145 print (struct buffer *) (($ & $valmask) | gdb_data_seg_bits) 237 print (struct buffer *) (($ & $valmask) | gdb_data_seg_bits)
146 output &((struct Lisp_String *) ((($->name) & $valmask) | gdb_data_seg_bits))->data 238 output &((struct Lisp_String *) ((($->name) & $valmask) | gdb_data_seg_bits))->data
147 echo \n 239 echo \n
148 end 240 end
149 document xbuffer 241 document xbuffer
150 Set $ as a buffer pointer, assuming it is an Emacs Lisp buffer value. 242 Set $ as a buffer pointer, assuming it is an Emacs Lisp buffer value.
151 Print the name of the buffer. 243 Print the name of the buffer.
152 end
153
154 define xsymbol
155 print (struct Lisp_Symbol *) ((((int) $) & $valmask) | gdb_data_seg_bits)
156 output (char*)&$->name->data
157 echo \n
158 end
159 document xsymbol
160 Print the name and address of the symbol $.
161 This command assumes that $ is an Emacs Lisp symbol value.
162 end
163
164 define xstring
165 print (struct Lisp_String *) (($ & $valmask) | gdb_data_seg_bits)
166 output ($->size > 1000) ? 0 : ($->data[0])@($->size_byte)
167 echo \n
168 end
169 document xstring
170 Print the contents and address of the string $.
171 This command assumes that $ is an Emacs Lisp string value.
172 end
173
174 define xvector
175 print (struct Lisp_Vector *) (($ & $valmask) | gdb_data_seg_bits)
176 output ($->size > 50) ? 0 : ($->contents[0])@($->size)
177 echo \n
178 end
179 document xvector
180 Print the contents and address of the vector $.
181 This command assumes that $ is an Emacs Lisp vector value.
182 end
183
184 define xframe
185 print (struct frame *) (($ & $valmask) | gdb_data_seg_bits)
186 end
187 document xframe
188 Print $ as a frame pointer, assuming it is an Emacs Lisp frame value.
189 end
190
191 define xwinconfig
192 print (struct save_window_data *) (($ & $valmask) | gdb_data_seg_bits)
193 end
194 document xwinconfig
195 Print $ as a window configuration pointer, assuming it is an Emacs Lisp window configuration value.
196 end
197
198 define xcompiled
199 print (struct Lisp_Vector *) (($ & $valmask) | gdb_data_seg_bits)
200 output ($->contents[0])@($->size & 0xff)
201 end
202 document xcompiled
203 Print $ as a compiled function pointer, assuming it is an Emacs Lisp compiled value.
204 end 244 end
205 245
206 define xcons 246 define xcons
207 print (struct Lisp_Cons *) (($ & $valmask) | gdb_data_seg_bits) 247 print (struct Lisp_Cons *) (($ & $valmask) | gdb_data_seg_bits)
208 output/x *$ 248 output/x *$
233 end 273 end
234 document xcdr 274 document xcdr
235 Print the cdr of $, assuming it is an Emacs Lisp pair. 275 Print the cdr of $, assuming it is an Emacs Lisp pair.
236 end 276 end
237 277
238 define xsubr
239 print (struct Lisp_Subr *) (($ & $valmask) | gdb_data_seg_bits)
240 output *$
241 echo \n
242 end
243 document xsubr
244 Print the address of the subr which the Lisp_Object $ points to.
245 end
246
247 define xprocess
248 print (struct Lisp_Process *) (($ & $valmask) | gdb_data_seg_bits)
249 output *$
250 echo \n
251 end
252 document xprocess
253 Print the address of the struct Lisp_process which the Lisp_Object $ points to.
254 end
255
256 define xfloat 278 define xfloat
257 print ((struct Lisp_Float *) (($ & $valmask) | gdb_data_seg_bits))->data 279 print ((struct Lisp_Float *) (($ & $valmask) | gdb_data_seg_bits))->data
258 end 280 end
259 document xfloat 281 document xfloat
260 Print $ assuming it is a lisp floating-point number. 282 Print $ assuming it is a lisp floating-point number.