annotate src/.gdbinit @ 638:40b255f55df3

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Sun, 10 May 1992 18:15:10 +0000
parents 696d82e36360
children 70b112526394
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1 # Set up something to print out s-expressions.
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2 define pr
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3 set Fprin1 ($, Qexternal_debugging_output)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4 echo \n
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6 document pr
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7 Print the emacs s-expression which is $.
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8 Works only when an inferior emacs is executing.
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 define xtype
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12 print (enum Lisp_Type) (($ >> 24) & 0x7f)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 p $$
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
15 document xtype
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
16 Print the type of $, assuming it is an Elisp value.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
17 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19 define xint
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20 print (($ & 0x00ffffff) << 8) >> 8
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
22 document xint
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
23 Print $, assuming it is an Elisp integer. This gets the sign right.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
24 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
26 define xptr
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27 print (void *) ($ & 0x00ffffff)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
29 document xptr
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
30 Print the pointer portion of $, assuming it is an Elisp value.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
31 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
32
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33 define xwindow
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34 print (struct window *) ($ & 0x00ffffff)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
35 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
36 document xwindow
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
37 Print $ as a window pointer, assuming it is an Elisp window value.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
38 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 define xmarker
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 print (struct Lisp_Marker *) ($ & 0x00ffffff)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
43 document xmarker
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
44 Print $ as a marker pointer, assuming it is an Elisp marker value.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
45 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
46
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
47 define xbuffer
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48 print (struct buffer *) ($ & 0x00ffffff)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
50 document xbuffer
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
51 Print $ as a buffer pointer, assuming it is an Elisp buffer value.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
52 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
53
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
54 define xsymbol
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55 print (struct Lisp_Symbol *) ($ & 0x00ffffff)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56 print &$->name->data
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
57 print $$
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
59 document xsymbol
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
60 Print the name and address of the symbol $.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
61 This command assumes that $ is an Elisp symbol value.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
62 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
64 define xstring
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
65 print (struct Lisp_String *) ($ & 0x00ffffff)
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
66 print ($->size > 10000) ? "big string" : ($->data[0])@($->size)
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
67 print $$
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
68 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
69 document xstring
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
70 Print the contents and address of the string $.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
71 This command assumes that $ is an Elisp string value.
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
72 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
73
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
74 define xvector
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
75 set $temp = (struct Lisp_Vector *) ($ & 0x00ffffff)
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
76 print ($temp->size > 10000) ? "big vector" : ($temp->contents[0])@($temp->size)
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
77 print $temp
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
78 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
79 document xvector
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
80 Print the contents and address of the vector $.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
81 This command assumes that $ is an Elisp vector value.
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
82 end
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
83
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
84 define xscreen
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
85 print (struct screen *) ($ & 0x00ffffff)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
86 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
87 document xwindow
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
88 Print $ as a screen pointer, assuming it is an Elisp screen value.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
89 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
90
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
91 define xcons
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
92 print (struct Lisp_Cons *) ($ & 0x00ffffff)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
93 print *$
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
94 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
95 document xcons
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
96 Print the contents of $, assuming it is an Elisp cons.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
97 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
98
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
99 define xcar
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
100 print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) ($ & 0x00ffffff))->car : 0)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
101 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
102 document xcar
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
103 Print the car of $, assuming it is an Elisp pair.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
104 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
105
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
106 define xcdr
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
107 print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) ($ & 0x00ffffff))->cdr : 0)
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
108 end
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
109 document xcdr
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
110 Print the cdr of $, assuming it is an Elisp pair.
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
111 end
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
112
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
113 set print pretty on
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
114
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
115 # Don't let abort actually run, as it will make
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
116 # stdio stop working and therefore the `pr' command below as well.
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
117 break abort
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
118
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
119 # If we are running in synchronous mode, we want a chance to look around
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
120 # before Emacs exits. Perhaps we should put the break somewhere else
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
121 # instead...
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
122 break _XPrintDefaultError
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
123
638
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
124 unset environment TERMCAP
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
125 unset environment TERM
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
126 set environment DISPLAY :0.0
40b255f55df3 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 567
diff changeset
127 show environment DISPLAY
567
696d82e36360 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
128 set args -q