annotate src/dbxrc @ 284:558f606b08ae r21-0b40

Import from CVS: tag r21-0b40
author cvs
date Mon, 13 Aug 2007 10:34:13 +0200
parents c5d627a313b1
children e11d67e05968
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
1 # -*- ksh -*-
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
2 # Copyright (C) 1998 Free Software Foundation, Inc.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
3
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
4 # This file is part of XEmacs.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
5
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
6 # XEmacs is free software; you can redistribute it and/or modify it
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
7 # under the terms of the GNU General Public License as published by the
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
8 # Free Software Foundation; either version 2, or (at your option) any
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
9 # later version.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
10
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
11 # XEmacs is distributed in the hope that it will be useful, but WITHOUT
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
14 # for more details.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
15
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
16 # You should have received a copy of the GNU General Public License
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
17 # along with XEmacs; see the file COPYING. If not, write to
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
18 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
19 # Boston, MA 02111-1307, USA.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
20
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
21 # Author: Martin Buchholz
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
22
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
23 # You can use this file to debug XEmacs using Sun WorkShop's dbx.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
24 # Add the contents of this file to $HOME/.dbxrc or
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
25 # Source the contents of this file with something like:
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
26 # test -r ./dbxrc && . ./dbxrc
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
27
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
28 # Some functions defined here require a running process, but most
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
29 # don't. Considerable effort has been expended to this end.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
30
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
31 # See also the comments in gdbinit.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
32
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
33 # See also the question of the XEmacs FAQ, titled
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
34 # "How to Debug an XEmacs problem with a debugger".
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
35
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
36 ignore POLL
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
37 ignore IO
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
38
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
39 document lbt << 'end'
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
40 Usage: lbt
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
41 Print the current Lisp stack trace.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
42 Requires a running xemacs process.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
43 end
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
44
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
45 function lbt {
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
46 call debug_backtrace()
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
47 }
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
48
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
49 document ldp << 'end'
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
50 Usage: ldp lisp_object
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
51 Print a Lisp Object value using the Lisp printer.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
52 Requires a running xemacs process.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
53 end
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
54
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
55 function ldp {
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
56 call debug_print ($1);
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
57 }
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
58
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
59 # A bug in dbx prevents string variables from having values beginning with `-'!!
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
60 function XEmacsInit {
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
61 eval $(echo $(whatis -t `alloc.c`dbg_constants) | \
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
62 perl -e 'print "@{[map {s/=(-\d+)/sprintf(q[=0x%x],$1)/oge; /\w+=[0-9a-fx]+/og} <>]}\n"')
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
63 xemacs_initted=yes
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
64 #printvar dbg_valbits dbg_valmask
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
65 }
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
66
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
67 function printvar {
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
68 for i in $*; do eval "echo $i=\$$i"; done
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
69 }
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
70
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
71 document decode_object << 'end'
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
72 Usage: decode_object lisp_object
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
73 Extract implementation information from a Lisp Object.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
74 Defines variables $val, $type and $imp.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
75 end
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
76
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
77 # Various dbx bugs cause ugliness in following code
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
78 function decode_object {
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
79 test -z "$xemacs_initted" && XEmacsInit
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
80 obj=$[*(void**)(&$1)]
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
81 test "$obj" = "(nil)" && obj="0x0"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
82 if test $dbg_USE_MINIMAL_TAGBITS = 1; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
83 if test $[(int)($obj & 1)] = 1; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
84 # It's an int
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
85 val=$[(long)(((unsigned long long)$obj) >> 1)]
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
86 type=$dbg_Lisp_Type_Int
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
87 else
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
88 type=$[(int)(((void*)$obj) & $dbg_typemask)]
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
89 if test $type = $dbg_Lisp_Type_Char; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
90 val=$[(void*)(long)(((unsigned long long)($obj & $dbg_valmask)) >> $dbg_gctypebits)]
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
91 else
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
92 # It's a record pointer
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
93 val=$[(void*)$obj]
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
94 fi
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
95 fi
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
96 else
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
97 # not dbg_USE_MINIMAL_TAGBITS
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
98 val=$[(void*)($obj & $dbg_valmask)]
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
99 test "$val" = "(nil)" && val="0x0"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
100 type=$[(int)(((unsigned long long)($obj & $dbg_typemask)) >> ($dbg_valbits + 1))]
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
101 fi
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
102
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
103 if test $type = $dbg_Lisp_Type_Record; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
104 typeset lheader="((struct lrecord_header *) $val)"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
105 if test $dbg_USE_INDEXED_LRECORD_IMPLEMENTATION = 1; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
106 imp=$[(void*)(lrecord_implementations_table[$lheader->type])]
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
107 else
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
108 imp=$[(void*)($lheader->implementation)]
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
109 fi
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
110 else
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
111 imp="0xdeadbeef"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
112 fi
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
113 #printvar obj val type imp
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
114 }
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
115
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
116 function xint {
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
117 decode_object "$*"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
118 print (long) ($val)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
119 }
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
120
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
121 function xtype {
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
122 decode_object "$*"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
123 if test $type = $dbg_Lisp_Type_Int; then echo "int"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
124 elif test $type = $dbg_Lisp_Type_Char; then echo "char"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
125 elif test $type = $dbg_Lisp_Type_Symbol; then echo "symbol"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
126 elif test $type = $dbg_Lisp_Type_String; then echo "string"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
127 elif test $type = $dbg_Lisp_Type_Vector; then echo "vector"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
128 elif test $type = $dbg_Lisp_Type_Cons; then echo "cons"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
129 else
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
130 echo "record type with name: $[((struct lrecord_implementation *)$imp)->name]"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
131 fi
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
132 }
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
133
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
134 document run-temacs << 'end'
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
135 Usage: run-temacs
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
136 Run temacs interactively, like xemacs.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
137 Use this with debugging tools (like purify) that cannot deal with dumping,
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
138 or when temacs builds successfully, but xemacs does not.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
139 end
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
140
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
141 function run-temacs {
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
142 unset EMACSLOADPATH
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
143 export EMACSBOOTSTRAPLOADPATH=../lisp/:..
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
144 run -batch -l ../lisp/loadup.el run-temacs -q
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
145 }
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
146
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
147 document update-elc << 'end'
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
148 Usage: update-elc
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
149 Run the core lisp byte compilation part of the build procedure.
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
150 Use when debugging temacs, not xemacs!
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
151 Use this when temacs builds successfully, but xemacs does not.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
152 end
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
153
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
154 function update-elc {
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
155 unset EMACSLOADPATH
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
156 export EMACSBOOTSTRAPLOADPATH=../lisp/:..
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
157 run -batch -l ../lisp/update-elc.el
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
158 }
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
159
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
160
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
161 function dump-temacs {
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
162 unset EMACSLOADPATH
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
163 export EMACSBOOTSTRAPLOADPATH=../lisp/:..
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
164 run -batch -l ../lisp/loadup.el dump
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
165 }
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
166
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
167 document dump-temacs << 'end'
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
168 Usage: dump-temacs
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
169 Run the dumping part of the build procedure.
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
170 Use when debugging temacs, not xemacs!
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
171 Use this when temacs builds successfully, but xemacs does not.
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
172 end
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
173
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
174 function pstruct {
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
175 xstruct="((struct $1 *) $val)"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
176 print $xstruct
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
177 print *$xstruct
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
178 }
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
179
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
180 function lrecord_type_p {
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
181 if eval test -z \"\$lrecord_$1\" && test $imp = $[(void*)(&lrecord_$1)]; then return 0; else return 1; fi
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
182 }
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
183
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
184 document pobj << 'end'
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
185 Usage: pobj lisp_object
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
186 Print the internal C structure of a underlying Lisp Object.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
187 end
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
188
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
189 function pobj {
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
190 decode_object $1
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
191 if test $type = $dbg_Lisp_Type_Int; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
192 print -f"Integer: %d" $val
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
193 elif test $type = $dbg_Lisp_Type_Char; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
194 if $val < 128; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
195 print -f"Char: %c" $val
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
196 else
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
197 print -f"Char: %d" $val
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
198 fi
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
199 elif test $type = $dbg_Lisp_Type_String || lrecord_type_p string; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
200 pstruct Lisp_String
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
201 elif test $type = $dbg_Lisp_Type_Cons || lrecord_type_p cons; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
202 pstruct Lisp_Cons
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
203 elif test $type = $dbg_Lisp_Type_Symbol || lrecord_type_p symbol; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
204 pstruct Lisp_Symbol
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
205 echo "Symbol name: $[(char *)($xstruct->name->_data)]"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
206 elif test $type = $dbg_Lisp_Type_Vector || lrecord_type_p vector; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
207 pstruct Lisp_Vector
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
208 echo "Vector of length $[$xstruct->size]"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
209 elif lrecord_type_p bit_vector; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
210 pstruct Lisp_Bit_Vector
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
211 elif lrecord_type_p buffer; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
212 pstruct buffer
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
213 elif lrecord_type_p char_table; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
214 pstruct Lisp_Char_Table
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
215 elif lrecord_type_p char_table_entry; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
216 pstruct Lisp_Char_Table_Entry
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
217 elif lrecord_type_p charset; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
218 pstruct Lisp_Charset
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
219 elif lrecord_type_p coding_system; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
220 pstruct Lisp_Coding_System
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
221 elif lrecord_type_p color_instance; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
222 pstruct Lisp_Color_Instance
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
223 elif lrecord_type_p command_builder; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
224 pstruct command_builder
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
225 elif lrecord_type_p compiled_function; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
226 pstruct Lisp_Compiled_Function
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
227 elif lrecord_type_p console; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
228 pstruct console
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
229 elif lrecord_type_p database; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
230 pstruct database
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
231 elif lrecord_type_p device; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
232 pstruct device
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
233 elif lrecord_type_p event; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
234 pstruct Lisp_Event
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
235 elif lrecord_type_p extent; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
236 pstruct extent
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
237 elif lrecord_type_p extent_auxiliary; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
238 pstruct extent_auxiliary
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
239 elif lrecord_type_p extent_info; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
240 pstruct extent_info
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
241 elif lrecord_type_p face; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
242 pstruct Lisp_Face
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
243 elif lrecord_type_p float; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
244 pstruct Lisp_Float
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
245 elif lrecord_type_p font_instance; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
246 pstruct Lisp_Font_Instance
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
247 elif lrecord_type_p frame; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
248 pstruct frame
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
249 elif lrecord_type_p glyph; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
250 pstruct Lisp_Glyph
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
251 elif lrecord_type_p hashtable; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
252 pstruct hashtable
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
253 elif lrecord_type_p image_instance; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
254 pstruct Lisp_Image_Instance
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
255 elif lrecord_type_p keymap; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
256 pstruct keymap
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
257 elif lrecord_type_p lcrecord_list; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
258 pstruct lcrecord_list
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
259 elif lrecord_type_p lstream; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
260 pstruct lstream
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
261 elif lrecord_type_p marker; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
262 pstruct Lisp_Marker
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
263 elif lrecord_type_p opaque; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
264 pstruct Lisp_Opaque
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
265 elif lrecord_type_p opaque_list; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
266 pstruct Lisp_Opaque_List
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
267 elif lrecord_type_p popup_data; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
268 pstruct popup_data
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
269 elif lrecord_type_p process; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
270 pstruct Lisp_Process
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
271 elif lrecord_type_p range_table; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
272 pstruct Lisp_Range_Table
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
273 elif lrecord_type_p specifier; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
274 pstruct Lisp_Specifier
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
275 elif lrecord_type_p subr; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
276 pstruct Lisp_Subr
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
277 elif lrecord_type_p symbol_value_buffer_local; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
278 pstruct symbol_value_buffer_local
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
279 elif lrecord_type_p symbol_value_forward; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
280 pstruct symbol_value_forward
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
281 elif lrecord_type_p symbol_value_lisp_magic; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
282 pstruct symbol_value_lisp_magic
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
283 elif lrecord_type_p symbol_value_varalias; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
284 pstruct symbol_value_varalias
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
285 elif lrecord_type_p toolbar_button; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
286 pstruct toolbar_button
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
287 elif lrecord_type_p toolbar_data; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
288 pstruct toolbar_data
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
289 elif lrecord_type_p tooltalk_message; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
290 pstruct Lisp_Tooltalk_Message
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
291 elif lrecord_type_p tooltalk_pattern; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
292 pstruct Lisp_Tooltalk_Pattern
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
293 elif lrecord_type_p weak_list; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
294 pstruct weak_list
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
295 elif lrecord_type_p window; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
296 pstruct window
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
297 elif lrecord_type_p window_configuration; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
298 pstruct window_config
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
299 else
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
300 echo "Unknown Lisp Object type"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
301 print $1
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
302 fi
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
303 }
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
304
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
305 function pproc {
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
306 print *(`process.c`struct Lisp_Process*)$1 ;
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
307 ldp "(`process.c`struct Lisp_Process*)$1->name" ;
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
308 ldp "(`process.c`struct Lisp_Process*)$1->command" ;
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
309 }
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
310
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
311 dbxenv suppress_startup_message 4.0
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
312
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
313 function dp_core {
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
314 print ((struct x_frame *)(((struct frame*)(Fselected_frame(Qnil)&0x00FFFFFF))->frame_data))->widget->core
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
315 }
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
316
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
317 # Barf!
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
318 function print_shell {
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
319 print *(`frame-x.c`TopLevelShellRec*) (((struct `frame-x.c`x_frame*) (((struct `frame-x.c`frame*) (Fselected_frame(Qnil)&0x00FFFFFF))->frame_data))->widget)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
320 }