1 # Set up something to print out s-expressions.
7 Print the emacs s-expression which is $.
8 Works only when an inferior emacs is executing.
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
16 set $data_seg_bits = 0x10000000
19 Set up the xfoo macros to deal with the MIPS processor.
20 Specifically, this sets $data_seg_bits to the right thing.
24 output (enum Lisp_Type) (($ >> 28) & 0x7)
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)
30 Print the type of $, assuming it is an Emacs Lisp value.
31 If the first type printed is Lisp_Vector or Lisp_Misc,
32 the second line gives the more precise type.
33 Otherwise the second line doesn't mean anything.
37 set $size = ((struct Lisp_Vector *) (($ & 0x0fffffff) | $data_seg_bits))->size
38 output (enum pvec_type) (($size & PVEC_FLAG) ? $size & PVEC_TYPE_MASK : 0)
42 Print the vector subtype of $, assuming it is a vector or pseudovector.
46 output (enum Lisp_Misc_Type) (((struct Lisp_Free *) (($ & 0x0fffffff) | $data_seg_bits))->type)
50 Print the specific type of $, assuming it is some misc type.
54 print (($ & 0x0fffffff) << 4) >> 4
57 Print $, assuming it is an Emacs Lisp integer. This gets the sign right.
61 print (void *) (($ & 0x0fffffff) | $data_seg_bits)
64 Print the pointer portion of $, assuming it is an Emacs Lisp value.
68 print (struct window *) (($ & 0x0fffffff) | $data_seg_bits)
69 printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top
72 Print $ as a window pointer, assuming it is an Emacs Lisp window value.
73 Print the window's position as "WIDTHxHEIGHT+LEFT+TOP".
77 print (struct Lisp_Marker *) (($ & 0x0fffffff) | $data_seg_bits)
80 Print $ as a marker pointer, assuming it is an Emacs Lisp marker value.
84 print (struct Lisp_Overlay *) (($ & 0x0fffffff) | $data_seg_bits)
87 Print $ as a overlay pointer, assuming it is an Emacs Lisp overlay value.
91 print (struct Lisp_Free *) (($ & 0x0fffffff) | $data_seg_bits)
94 Print $ as a misc free-cell pointer, assuming it is an Emacs Lisp Misc value.
98 print (struct Lisp_Intfwd *) (($ & 0x0fffffff) | $data_seg_bits)
101 Print $ as an integer forwarding pointer, assuming it is an Emacs Lisp Misc value.
105 print (struct Lisp_Boolfwd *) (($ & 0x0fffffff) | $data_seg_bits)
108 Print $ as a boolean forwarding pointer, assuming it is an Emacs Lisp Misc value.
112 print (struct Lisp_Objfwd *) (($ & 0x0fffffff) | $data_seg_bits)
115 Print $ as an object forwarding pointer, assuming it is an Emacs Lisp Misc value.
118 define xbuffer_objfwd
119 print (struct Lisp_Buffer_Objfwd *) (($ & 0x0fffffff) | $data_seg_bits)
121 document xbuffer_objfwd
122 Print $ as a buffer-local object forwarding pointer, assuming it is an Emacs Lisp Misc value.
125 define xbuffer_local_value
126 print (struct Lisp_Buffer_Local_Value *) (($ & 0x0fffffff) | $data_seg_bits)
128 document xbuffer_local_value
129 Print $ as a buffer-local-value pointer, assuming it is an Emacs Lisp Misc value.
133 print (struct buffer *) (($ & 0x0fffffff) | $data_seg_bits)
134 output &((struct Lisp_String *) ((($->name) & 0x0fffffff) | $data_seg_bits))->data
138 Set $ as a buffer pointer, assuming it is an Emacs Lisp buffer value.
139 Print the name of the buffer.
143 print (struct Lisp_Symbol *) ((((int) $) & 0x0fffffff) | $data_seg_bits)
144 output &$->name->data
148 Print the name and address of the symbol $.
149 This command assumes that $ is an Emacs Lisp symbol value.
153 print (struct Lisp_String *) (($ & 0x0fffffff) | $data_seg_bits)
154 output ($->size > 1000) ? 0 : ($->data[0])@($->size)
158 Print the contents and address of the string $.
159 This command assumes that $ is an Emacs Lisp string value.
163 print (struct Lisp_Vector *) (($ & 0x0fffffff) | $data_seg_bits)
164 output ($->size > 50) ? 0 : ($->contents[0])@($->size)
168 Print the contents and address of the vector $.
169 This command assumes that $ is an Emacs Lisp vector value.
173 print (struct frame *) (($ & 0x0fffffff) | $data_seg_bits)
176 Print $ as a frame pointer, assuming it is an Emacs Lisp frame value.
179 define xwindow_configuration
180 print (struct save_window_data *) (($ & 0x0fffffff) | $data_seg_bits)
182 document xwindow_configuration
183 Print $ as a window configuration pointer, assuming it is an Emacs Lisp window configuration value.
187 print (struct Lisp_Vector *) (($ & 0x0fffffff) | $data_seg_bits)
188 output ($->contents[0])@($->size & 0xff)
191 Print $ as a compiled function pointer, assuming it is an Emacs Lisp compiled value.
195 print (struct Lisp_Cons *) (($ & 0x0fffffff) | $data_seg_bits)
200 Print the contents of $, assuming it is an Emacs Lisp cons.
204 print ((($ >> 28) & 0xf) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & 0x0fffffff) | $data_seg_bits))->car : 0)
207 Print the car of $, assuming it is an Emacs Lisp pair.
211 print ((($ >> 28) & 0xf) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & 0x0fffffff) | $data_seg_bits))->cdr : 0)
214 Print the cdr of $, assuming it is an Emacs Lisp pair.
218 print (struct Lisp_Subr *) (($ & 0x0fffffff) | $data_seg_bits)
223 Print the address of the subr which the Lisp_Object $ points to.
227 print (struct Lisp_Process *) (($ & 0x0fffffff) | $data_seg_bits)
232 Print the address of the struct Lisp_process which the Lisp_Object $ points to.
236 print ((struct Lisp_Float *) (($ & 0x0fffffff) | $data_seg_bits))->data
239 Print $ assuming it is a lisp floating-point number.
243 print (struct scrollbar *) (($ & 0x0fffffff) | $data_seg_bits)
248 Print $ as a scrollbar pointer.
252 set print sevenbit-strings
254 show environment DISPLAY
255 show environment TERM
256 set args -geometry 80x40+0+0
258 # Don't let abort actually run, as it will make
259 # stdio stop working and therefore the `pr' command above as well.
262 # If we are running in synchronous mode, we want a chance to look around
263 # before Emacs exits. Perhaps we should put the break somewhere else
265 break x_error_quitter