Initial revision
[bpt/emacs.git] / src / .gdbinit
CommitLineData
a6ffc6a2
JB
1# Set up something to print out s-expressions.
2define pr
3set Fprin1 ($, Qexternal_debugging_output)
4echo \n
5end
6
7document pr
8Print the emacs s-expression which is $.
9Works only when an inferior emacs is executing.
10end
11
12define xtype
13print (enum Lisp_Type) (($ >> 24) & 0x7f)
14p $$
15end
16
17define xint
18print (($ & 0x00ffffff) << 8) >> 8
19end
20
21define xptr
22print (void *) ($ & 0x00ffffff)
23end
24
25define xwindow
26print (struct window *) ($ & 0x00ffffff)
27end
28
29define xmarker
30print (struct Lisp_Marker *) ($ & 0x00ffffff)
31end
32
33define xbuffer
34print (struct buffer *) ($ & 0x00ffffff)
35end
36
37define xsymbol
38print (struct Lisp_Symbol *) ($ & 0x00ffffff)
39print &$->name->data
40print $$
41end
42
43define xstring
44print (struct Lisp_String *) ($ & 0x00ffffff)
45print ($->data[0])@($->size)
46print $$
47end
48
49document xstring
50Assume that $ is an Emacs Lisp string object, print the string's
51contents, and set $ to a pointer to the string.
52end
53
54define xvector
55set $temp = (struct Lisp_Vector *) ($ & 0x00ffffff)
56print ($temp->contents[0])@($temp->size)
57print $temp
58end
59
60document xvector
61Assume that $ is an Emacs Lisp vector object, print the vector's
62contents, and set $ to a pointer to the vector.
63end
64
65define xscreen
66print (struct screen *) ($ & 0x00ffffff)
67end
68
69define xcons
70print (struct Lisp_Cons *) ($ & 0x00ffffff)
71print *$
72end
73
74define xcar
75print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) ($ & 0x00ffffff))->car : 0)
76end
77
78define xcdr
79print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) ($ & 0x00ffffff))->cdr : 0)
80end
81
82set prettyprint on
83
84# Don't let abort actually run, as it will make
85# stdio stop working and therefore the `pr' command below as well.
86break abort
87
88# If we are running in synchronous mode, we want a chance to look around
89# before Emacs exits. Perhaps we should put the break somewhere else
90# instead...
91break _XPrintDefaultError
92
93unset env TERMCAP
94unset env TERM
95set env DISPLAY :0.0
96info env DISPLAY
97set args -q