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