comparison src/.gdbinit @ 10299:0de933eb95a2

Adapt to new Lisp_Object format. (xvectype, xmisctype): New commands. (xtype): Print the misc or vectorlike subtype too.
author Richard M. Stallman <rms@gnu.org>
date Mon, 02 Jan 1995 05:04:34 +0000
parents def3ab3a6f01
children a76a89bb6c57
comparison
equal deleted inserted replaced
10298:4b66ac3460df 10299:0de933eb95a2
19 Set up the xfoo macros to deal with the MIPS processor. 19 Set up the xfoo macros to deal with the MIPS processor.
20 Specifically, this sets $data_seg_bits to the right thing. 20 Specifically, this sets $data_seg_bits to the right thing.
21 end 21 end
22 22
23 define xtype 23 define xtype
24 output (enum Lisp_Type) (($ >> 24) & 0x7f) 24 output (enum Lisp_Type) (($ >> 28) & 0x7)
25 echo \n
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)
25 echo \n 27 echo \n
26 end 28 end
27 document xtype 29 document xtype
28 Print the type of $, assuming it is an Emacs Lisp value. 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.
34 end
35
36 define xvectype
37 set $size = ((struct Lisp_Vector *) (($ & 0x0fffffff) | $data_seg_bits))->size
38 output (enum pvec_type) (($size & PVEC_FLAG) ? $size & PVEC_TYPE_MASK : 0)
39 echo \n
40 end
41 document xvectype
42 Print the vector subtype of $, assuming it is a vector or pseudovector.
43 end
44
45 define xmisctype
46 output (enum Lisp_Misc_Type) (((struct Lisp_Free *) (($ & 0x0fffffff) | $data_seg_bits))->type)
47 echo \n
48 end
49 document xmisctype
50 Print the specific type of $, assuming it is some misc type.
29 end 51 end
30 52
31 define xint 53 define xint
32 print (($ & 0x00ffffff) << 8) >> 8 54 print (($ & 0x00ffffff) << 4) >> 4
33 end 55 end
34 document xint 56 document xint
35 Print $, assuming it is an Emacs Lisp integer. This gets the sign right. 57 Print $, assuming it is an Emacs Lisp integer. This gets the sign right.
36 end 58 end
37 59
38 define xptr 60 define xptr
39 print (void *) (($ & 0x00ffffff) | $data_seg_bits) 61 print (void *) (($ & 0x0fffffff) | $data_seg_bits)
40 end 62 end
41 document xptr 63 document xptr
42 Print the pointer portion of $, assuming it is an Emacs Lisp value. 64 Print the pointer portion of $, assuming it is an Emacs Lisp value.
43 end 65 end
44 66
45 define xwindow 67 define xwindow
46 print (struct window *) (($ & 0x00ffffff) | $data_seg_bits) 68 print (struct window *) (($ & 0x0fffffff) | $data_seg_bits)
47 printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top 69 printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top
48 end 70 end
49 document xwindow 71 document xwindow
50 Print $ as a window pointer, assuming it is an Emacs Lisp window value. 72 Print $ as a window pointer, assuming it is an Emacs Lisp window value.
51 Print the window's position as "WIDTHxHEIGHT+LEFT+TOP". 73 Print the window's position as "WIDTHxHEIGHT+LEFT+TOP".
52 end 74 end
53 75
54 define xmarker 76 define xmarker
55 print (struct Lisp_Marker *) (($ & 0x00ffffff) | $data_seg_bits) 77 print (struct Lisp_Marker *) (($ & 0x0fffffff) | $data_seg_bits)
56 end 78 end
57 document xmarker 79 document xmarker
58 Print $ as a marker pointer, assuming it is an Emacs Lisp marker value. 80 Print $ as a marker pointer, assuming it is an Emacs Lisp marker value.
59 end 81 end
60 82
61 define xbuffer 83 define xbuffer
62 print (struct buffer *) (($ & 0x00ffffff) | $data_seg_bits) 84 print (struct buffer *) (($ & 0x0fffffff) | $data_seg_bits)
63 output &((struct Lisp_String *) ((($->name) & 0x00ffffff) | $data_seg_bits))->data 85 output &((struct Lisp_String *) ((($->name) & 0x0fffffff) | $data_seg_bits))->data
64 echo \n 86 echo \n
65 end 87 end
66 document xbuffer 88 document xbuffer
67 Set $ as a buffer pointer, assuming it is an Emacs Lisp buffer value. 89 Set $ as a buffer pointer, assuming it is an Emacs Lisp buffer value.
68 Print the name of the buffer. 90 Print the name of the buffer.
69 end 91 end
70 92
71 define xsymbol 93 define xsymbol
72 print (struct Lisp_Symbol *) ((((int) $) & 0x00ffffff) | $data_seg_bits) 94 print (struct Lisp_Symbol *) ((((int) $) & 0x0fffffff) | $data_seg_bits)
73 output &$->name->data 95 output &$->name->data
74 echo \n 96 echo \n
75 end 97 end
76 document xsymbol 98 document xsymbol
77 Print the name and address of the symbol $. 99 Print the name and address of the symbol $.
78 This command assumes that $ is an Emacs Lisp symbol value. 100 This command assumes that $ is an Emacs Lisp symbol value.
79 end 101 end
80 102
81 define xstring 103 define xstring
82 print (struct Lisp_String *) (($ & 0x00ffffff) | $data_seg_bits) 104 print (struct Lisp_String *) (($ & 0x0fffffff) | $data_seg_bits)
83 output ($->size > 1000) ? 0 : ($->data[0])@($->size) 105 output ($->size > 1000) ? 0 : ($->data[0])@($->size)
84 echo \n 106 echo \n
85 end 107 end
86 document xstring 108 document xstring
87 Print the contents and address of the string $. 109 Print the contents and address of the string $.
88 This command assumes that $ is an Emacs Lisp string value. 110 This command assumes that $ is an Emacs Lisp string value.
89 end 111 end
90 112
91 define xvector 113 define xvector
92 print (struct Lisp_Vector *) (($ & 0x00ffffff) | $data_seg_bits) 114 print (struct Lisp_Vector *) (($ & 0x0fffffff) | $data_seg_bits)
93 output ($->size > 50) ? 0 : ($->contents[0])@($->size) 115 output ($->size > 50) ? 0 : ($->contents[0])@($->size)
94 echo \n 116 echo \n
95 end 117 end
96 document xvector 118 document xvector
97 Print the contents and address of the vector $. 119 Print the contents and address of the vector $.
98 This command assumes that $ is an Emacs Lisp vector value. 120 This command assumes that $ is an Emacs Lisp vector value.
99 end 121 end
100 122
101 define xframe 123 define xframe
102 print (struct frame *) (($ & 0x00ffffff) | $data_seg_bits) 124 print (struct frame *) (($ & 0x0fffffff) | $data_seg_bits)
103 end 125 end
104 document xframe 126 document xframe
105 Print $ as a frame pointer, assuming it is an Emacs Lisp frame value. 127 Print $ as a frame pointer, assuming it is an Emacs Lisp frame value.
106 end 128 end
107 129
108 define xcons 130 define xcons
109 print (struct Lisp_Cons *) (($ & 0x00ffffff) | $data_seg_bits) 131 print (struct Lisp_Cons *) (($ & 0x0fffffff) | $data_seg_bits)
110 output *$ 132 output *$
111 echo \n 133 echo \n
112 end 134 end
113 document xcons 135 document xcons
114 Print the contents of $, assuming it is an Emacs Lisp cons. 136 Print the contents of $, assuming it is an Emacs Lisp cons.
115 end 137 end
116 138
117 define xcar 139 define xcar
118 print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & 0x00ffffff) | $data_seg_bits))->car : 0) 140 print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & 0x0fffffff) | $data_seg_bits))->car : 0)
119 end 141 end
120 document xcar 142 document xcar
121 Print the car of $, assuming it is an Emacs Lisp pair. 143 Print the car of $, assuming it is an Emacs Lisp pair.
122 end 144 end
123 145
124 define xcdr 146 define xcdr
125 print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & 0x00ffffff) | $data_seg_bits))->cdr : 0) 147 print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & 0x0fffffff) | $data_seg_bits))->cdr : 0)
126 end 148 end
127 document xcdr 149 document xcdr
128 Print the cdr of $, assuming it is an Emacs Lisp pair. 150 Print the cdr of $, assuming it is an Emacs Lisp pair.
129 end 151 end
130 152
131 define xsubr 153 define xsubr
132 print (struct Lisp_Subr *) (($ & 0x00ffffff) | $data_seg_bits) 154 print (struct Lisp_Subr *) (($ & 0x0fffffff) | $data_seg_bits)
133 output *$ 155 output *$
134 echo \n 156 echo \n
135 end 157 end
136 document xsubr 158 document xsubr
137 Print the address of the subr which the Lisp_Object $ points to. 159 Print the address of the subr which the Lisp_Object $ points to.
138 end 160 end
139 161
140 define xprocess 162 define xprocess
141 print (struct Lisp_Process *) (($ & 0x00ffffff) | $data_seg_bits) 163 print (struct Lisp_Process *) (($ & 0x0fffffff) | $data_seg_bits)
142 output *$ 164 output *$
143 echo \n 165 echo \n
144 end 166 end
145 document xprocess 167 document xprocess
146 Print the address of the struct Lisp_process which the Lisp_Object $ points to. 168 Print the address of the struct Lisp_process which the Lisp_Object $ points to.
147 end 169 end
148 170
149 define xfloat 171 define xfloat
150 print ((struct Lisp_Float *) (($ & 0x00ffffff) | $data_seg_bits))->data 172 print ((struct Lisp_Float *) (($ & 0x0fffffff) | $data_seg_bits))->data
151 end 173 end
152 document xfloat 174 document xfloat
153 Print $ assuming it is a lisp floating-point number. 175 Print $ assuming it is a lisp floating-point number.
154 end 176 end
155 177
156 define xscrollbar 178 define xscrollbar
157 print (struct scrollbar *) (($ & 0x00ffffff) | $data_seg_bits) 179 print (struct scrollbar *) (($ & 0x0fffffff) | $data_seg_bits)
158 output *$ 180 output *$
159 echo \n 181 echo \n
160 end 182 end
161 document xscrollbar 183 document xscrollbar
162 Print $ as a scrollbar pointer. 184 Print $ as a scrollbar pointer.