aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1995-01-02 05:04:34 +0000
committerRichard M. Stallman1995-01-02 05:04:34 +0000
commit3fe8bda56f651afc2846cfac561dfff604cb846f (patch)
treefc4938928a05255cea9fbbadcf4c22ef04394741 /src
parentc11a94fe5346f85b94ac3516b316ba92846c9259 (diff)
downloademacs-3fe8bda56f651afc2846cfac561dfff604cb846f.tar.gz
emacs-3fe8bda56f651afc2846cfac561dfff604cb846f.zip
Adapt to new Lisp_Object format.
(xvectype, xmisctype): New commands. (xtype): Print the misc or vectorlike subtype too.
Diffstat (limited to 'src')
-rw-r--r--src/.gdbinit58
1 files changed, 40 insertions, 18 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index 9c354b5607d..8299b814564 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -21,29 +21,51 @@ Specifically, this sets $data_seg_bits to the right thing.
21end 21end
22 22
23define xtype 23define xtype
24output (enum Lisp_Type) (($ >> 24) & 0x7f) 24output (enum Lisp_Type) (($ >> 28) & 0x7)
25echo \n
26output ((($ >> 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)
25echo \n 27echo \n
26end 28end
27document xtype 29document xtype
28Print the type of $, assuming it is an Emacs Lisp value. 30Print the type of $, assuming it is an Emacs Lisp value.
31If the first type printed is Lisp_Vector or Lisp_Misc,
32the second line gives the more precise type.
33Otherwise the second line doesn't mean anything.
34end
35
36define xvectype
37set $size = ((struct Lisp_Vector *) (($ & 0x0fffffff) | $data_seg_bits))->size
38output (enum pvec_type) (($size & PVEC_FLAG) ? $size & PVEC_TYPE_MASK : 0)
39echo \n
40end
41document xvectype
42Print the vector subtype of $, assuming it is a vector or pseudovector.
43end
44
45define xmisctype
46output (enum Lisp_Misc_Type) (((struct Lisp_Free *) (($ & 0x0fffffff) | $data_seg_bits))->type)
47echo \n
48end
49document xmisctype
50Print the specific type of $, assuming it is some misc type.
29end 51end
30 52
31define xint 53define xint
32print (($ & 0x00ffffff) << 8) >> 8 54print (($ & 0x00ffffff) << 4) >> 4
33end 55end
34document xint 56document xint
35Print $, assuming it is an Emacs Lisp integer. This gets the sign right. 57Print $, assuming it is an Emacs Lisp integer. This gets the sign right.
36end 58end
37 59
38define xptr 60define xptr
39print (void *) (($ & 0x00ffffff) | $data_seg_bits) 61print (void *) (($ & 0x0fffffff) | $data_seg_bits)
40end 62end
41document xptr 63document xptr
42Print the pointer portion of $, assuming it is an Emacs Lisp value. 64Print the pointer portion of $, assuming it is an Emacs Lisp value.
43end 65end
44 66
45define xwindow 67define xwindow
46print (struct window *) (($ & 0x00ffffff) | $data_seg_bits) 68print (struct window *) (($ & 0x0fffffff) | $data_seg_bits)
47printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top 69printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top
48end 70end
49document xwindow 71document xwindow
@@ -52,15 +74,15 @@ Print the window's position as "WIDTHxHEIGHT+LEFT+TOP".
52end 74end
53 75
54define xmarker 76define xmarker
55print (struct Lisp_Marker *) (($ & 0x00ffffff) | $data_seg_bits) 77print (struct Lisp_Marker *) (($ & 0x0fffffff) | $data_seg_bits)
56end 78end
57document xmarker 79document xmarker
58Print $ as a marker pointer, assuming it is an Emacs Lisp marker value. 80Print $ as a marker pointer, assuming it is an Emacs Lisp marker value.
59end 81end
60 82
61define xbuffer 83define xbuffer
62print (struct buffer *) (($ & 0x00ffffff) | $data_seg_bits) 84print (struct buffer *) (($ & 0x0fffffff) | $data_seg_bits)
63output &((struct Lisp_String *) ((($->name) & 0x00ffffff) | $data_seg_bits))->data 85output &((struct Lisp_String *) ((($->name) & 0x0fffffff) | $data_seg_bits))->data
64echo \n 86echo \n
65end 87end
66document xbuffer 88document xbuffer
@@ -69,7 +91,7 @@ Print the name of the buffer.
69end 91end
70 92
71define xsymbol 93define xsymbol
72print (struct Lisp_Symbol *) ((((int) $) & 0x00ffffff) | $data_seg_bits) 94print (struct Lisp_Symbol *) ((((int) $) & 0x0fffffff) | $data_seg_bits)
73output &$->name->data 95output &$->name->data
74echo \n 96echo \n
75end 97end
@@ -79,7 +101,7 @@ This command assumes that $ is an Emacs Lisp symbol value.
79end 101end
80 102
81define xstring 103define xstring
82print (struct Lisp_String *) (($ & 0x00ffffff) | $data_seg_bits) 104print (struct Lisp_String *) (($ & 0x0fffffff) | $data_seg_bits)
83output ($->size > 1000) ? 0 : ($->data[0])@($->size) 105output ($->size > 1000) ? 0 : ($->data[0])@($->size)
84echo \n 106echo \n
85end 107end
@@ -89,7 +111,7 @@ This command assumes that $ is an Emacs Lisp string value.
89end 111end
90 112
91define xvector 113define xvector
92print (struct Lisp_Vector *) (($ & 0x00ffffff) | $data_seg_bits) 114print (struct Lisp_Vector *) (($ & 0x0fffffff) | $data_seg_bits)
93output ($->size > 50) ? 0 : ($->contents[0])@($->size) 115output ($->size > 50) ? 0 : ($->contents[0])@($->size)
94echo \n 116echo \n
95end 117end
@@ -99,14 +121,14 @@ This command assumes that $ is an Emacs Lisp vector value.
99end 121end
100 122
101define xframe 123define xframe
102print (struct frame *) (($ & 0x00ffffff) | $data_seg_bits) 124print (struct frame *) (($ & 0x0fffffff) | $data_seg_bits)
103end 125end
104document xframe 126document xframe
105Print $ as a frame pointer, assuming it is an Emacs Lisp frame value. 127Print $ as a frame pointer, assuming it is an Emacs Lisp frame value.
106end 128end
107 129
108define xcons 130define xcons
109print (struct Lisp_Cons *) (($ & 0x00ffffff) | $data_seg_bits) 131print (struct Lisp_Cons *) (($ & 0x0fffffff) | $data_seg_bits)
110output *$ 132output *$
111echo \n 133echo \n
112end 134end
@@ -115,21 +137,21 @@ Print the contents of $, assuming it is an Emacs Lisp cons.
115end 137end
116 138
117define xcar 139define xcar
118print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & 0x00ffffff) | $data_seg_bits))->car : 0) 140print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & 0x0fffffff) | $data_seg_bits))->car : 0)
119end 141end
120document xcar 142document xcar
121Print the car of $, assuming it is an Emacs Lisp pair. 143Print the car of $, assuming it is an Emacs Lisp pair.
122end 144end
123 145
124define xcdr 146define xcdr
125print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & 0x00ffffff) | $data_seg_bits))->cdr : 0) 147print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) (($ & 0x0fffffff) | $data_seg_bits))->cdr : 0)
126end 148end
127document xcdr 149document xcdr
128Print the cdr of $, assuming it is an Emacs Lisp pair. 150Print the cdr of $, assuming it is an Emacs Lisp pair.
129end 151end
130 152
131define xsubr 153define xsubr
132print (struct Lisp_Subr *) (($ & 0x00ffffff) | $data_seg_bits) 154print (struct Lisp_Subr *) (($ & 0x0fffffff) | $data_seg_bits)
133output *$ 155output *$
134echo \n 156echo \n
135end 157end
@@ -138,7 +160,7 @@ Print the address of the subr which the Lisp_Object $ points to.
138end 160end
139 161
140define xprocess 162define xprocess
141print (struct Lisp_Process *) (($ & 0x00ffffff) | $data_seg_bits) 163print (struct Lisp_Process *) (($ & 0x0fffffff) | $data_seg_bits)
142output *$ 164output *$
143echo \n 165echo \n
144end 166end
@@ -147,14 +169,14 @@ Print the address of the struct Lisp_process which the Lisp_Object $ points to.
147end 169end
148 170
149define xfloat 171define xfloat
150print ((struct Lisp_Float *) (($ & 0x00ffffff) | $data_seg_bits))->data 172print ((struct Lisp_Float *) (($ & 0x0fffffff) | $data_seg_bits))->data
151end 173end
152document xfloat 174document xfloat
153Print $ assuming it is a lisp floating-point number. 175Print $ assuming it is a lisp floating-point number.
154end 176end
155 177
156define xscrollbar 178define xscrollbar
157print (struct scrollbar *) (($ & 0x00ffffff) | $data_seg_bits) 179print (struct scrollbar *) (($ & 0x0fffffff) | $data_seg_bits)
158output *$ 180output *$
159echo \n 181echo \n
160end 182end