annotate src/dbxrc @ 382:064ab7fed2e0 r21-2-6

Import from CVS: tag r21-2-6
author cvs
date Mon, 13 Aug 2007 11:07:39 +0200
parents 8626e4521993
children 6719134a07c2
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:
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
26 # if test -r ./dbxrc; then . ./dbxrc; fi
2
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 {
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
61 eval $(echo $(whatis -t `alloc.c`dbg_constants) | \
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
62 perl -e 'print "@{[map {s/=(-\d+)/sprintf(q[=0x%x],$1)/oge; /\w+=[0-9a-fx]+/og} <>]}\n"')
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
63 xemacs_initted=yes
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
64 #printvar dbg_valbits dbg_valmask
272
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 {
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
79 if test -z "$xemacs_initted"; then XEmacsInit; fi;
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
80 if test $dbg_USE_UNION_TYPE = 1; then
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
81 # Repeat after me... dbx sux, dbx sux, dbx sux...
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
82 # Allow both `pobj Qnil' and `pobj 0x82746834' to work
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
83 case $(whatis $1) in
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
84 *Lisp_Object*) obj="$[(unsigned long)(($1).i)]";;
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
85 *) obj="$[(unsigned long)($1)]";;
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
86 esac
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
87 else
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
88 obj="$[(unsigned long)($1)]";
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
89 fi
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
90 if test $dbg_USE_MINIMAL_TAGBITS = 1; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
91 if test $[(int)($obj & 1)] = 1; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
92 # It's an int
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
93 val=$[(long)(((unsigned long long)$obj) >> 1)]
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
94 type=$dbg_Lisp_Type_Int
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
95 else
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
96 type=$[(int)(((void*)$obj) & $dbg_typemask)]
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
97 if test $type = $dbg_Lisp_Type_Char; then
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
98 val=$[(void*)(long)(((unsigned long long)($obj & $dbg_valmask)) >> $dbg_gctypebits)]
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
99 else
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
100 # It's a record pointer
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
101 val=$[(void*)$obj]
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
102 if test "$val" = "(nil)"; then type=null_pointer; fi
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
103 fi
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
104 fi
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
105 else
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
106 # not dbg_USE_MINIMAL_TAGBITS
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
107 type=$[(int)(((unsigned long long)($obj & $dbg_typemask)) >> ($dbg_valbits + 1))]
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
108 if test "$[$type == Lisp_Type_Int]" = 1; then
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
109 val=$[(int)($obj & $dbg_valmask)]
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
110 elif test "$[$type == Lisp_Type_Char]" = 1; then
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
111 val=$[(int)($obj & $dbg_valmask)]
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
112 else
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
113 val=$[(void*)($obj & $dbg_valmask)]
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
114 if test "$val" = "(nil)"; then type=null_pointer; fi
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
115 fi
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
116 #val=$[(void*)($obj & $dbg_valmask)]
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
117 #printvar val type obj
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
118 fi
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
119
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
120 if test $type = $dbg_Lisp_Type_Record; then
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
121 typeset lheader="((struct lrecord_header *) $val)"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
122 if test $dbg_USE_INDEXED_LRECORD_IMPLEMENTATION = 1; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
123 imp=$[(void*)(lrecord_implementations_table[$lheader->type])]
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
124 else
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
125 imp=$[(void*)($lheader->implementation)]
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
126 fi
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
127 else
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
128 imp="0xdeadbeef"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
129 fi
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
130 #printvar obj val type imp
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
131 }
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
132
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
133 function xint {
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
134 decode_object "$*"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
135 print (long) ($val)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
136 }
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
137
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
138 function xtype {
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
139 decode_object "$*"
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
140 if test $type = $dbg_Lisp_Type_Int; then echo "int"
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
141 elif test $type = $dbg_Lisp_Type_Char; then echo "char"
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
142 elif test $type = $dbg_Lisp_Type_Symbol; then echo "symbol"
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
143 elif test $type = $dbg_Lisp_Type_String; then echo "string"
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
144 elif test $type = $dbg_Lisp_Type_Vector; then echo "vector"
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
145 elif test $type = $dbg_Lisp_Type_Cons; then echo "cons"
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
146 elif test $type = null_pointer; then echo "$type"
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
147 else
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
148 echo "record type with name: $[((struct lrecord_implementation *)$imp)->name]"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
149 fi
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
150 }
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
151
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
152 document run-temacs << 'end'
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
153 Usage: run-temacs
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
154 Run temacs interactively, like xemacs.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
155 Use this with debugging tools (like purify) that cannot deal with dumping,
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
156 or when temacs builds successfully, but xemacs does not.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
157 end
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
158
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
159 function run-temacs {
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
160 unset EMACSLOADPATH
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
161 export EMACSBOOTSTRAPLOADPATH=../lisp/:..
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
162 run -batch -l ../lisp/loadup.el run-temacs -q
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
163 }
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
164
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
165 document update-elc << 'end'
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
166 Usage: update-elc
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
167 Run the core lisp byte compilation part of the build procedure.
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
168 Use when debugging temacs, not xemacs!
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
169 Use this when temacs builds successfully, but xemacs does not.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
170 end
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
171
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
172 function update-elc {
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
173 unset EMACSLOADPATH
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
174 export EMACSBOOTSTRAPLOADPATH=../lisp/:..
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
175 run -batch -l ../lisp/update-elc.el
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
176 }
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
177
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
178
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
179 function dump-temacs {
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
180 unset EMACSLOADPATH
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
181 export EMACSBOOTSTRAPLOADPATH=../lisp/:..
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
182 run -batch -l ../lisp/loadup.el dump
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
183 }
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
184
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
185 document dump-temacs << 'end'
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
186 Usage: dump-temacs
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
187 Run the dumping part of the build procedure.
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
188 Use when debugging temacs, not xemacs!
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
189 Use this when temacs builds successfully, but xemacs does not.
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
190 end
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 272
diff changeset
191
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
192 function pstruct {
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
193 xstruct="((struct $1 *) $val)"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
194 print $xstruct
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
195 print *$xstruct
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
196 }
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
197
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
198 function lrecord_type_p {
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
199 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
200 }
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
201
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
202 document pobj << 'end'
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
203 Usage: pobj lisp_object
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
204 Print the internal C structure of a underlying Lisp Object.
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
205 end
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
206
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
207 function pobj {
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
208 decode_object $1
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
209 if test $type = $dbg_Lisp_Type_Int; then
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
210 print -f"Integer: %d" $val
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
211 elif test $type = $dbg_Lisp_Type_Char; then
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
212 if $val < 128; then
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
213 print -f"Char: %c" $val
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
214 else
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
215 print -f"Char: %d" $val
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
216 fi
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
217 elif test $type = $dbg_Lisp_Type_String || lrecord_type_p string; then
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
218 pstruct Lisp_String
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
219 elif test $type = $dbg_Lisp_Type_Cons || lrecord_type_p cons; then
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
220 pstruct Lisp_Cons
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
221 elif test $type = $dbg_Lisp_Type_Symbol || lrecord_type_p symbol; then
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
222 pstruct Lisp_Symbol
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
223 echo "Symbol name: $[(char *)($xstruct->name->_data)]"
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 337
diff changeset
224 elif test $type = $dbg_Lisp_Type_Vector || lrecord_type_p vector; then
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
225 pstruct Lisp_Vector
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
226 echo "Vector of length $[$xstruct->size]"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
227 elif lrecord_type_p bit_vector; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
228 pstruct Lisp_Bit_Vector
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
229 elif lrecord_type_p buffer; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
230 pstruct buffer
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
231 elif lrecord_type_p char_table; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
232 pstruct Lisp_Char_Table
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
233 elif lrecord_type_p char_table_entry; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
234 pstruct Lisp_Char_Table_Entry
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
235 elif lrecord_type_p charset; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
236 pstruct Lisp_Charset
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
237 elif lrecord_type_p coding_system; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
238 pstruct Lisp_Coding_System
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
239 elif lrecord_type_p color_instance; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
240 pstruct Lisp_Color_Instance
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
241 elif lrecord_type_p command_builder; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
242 pstruct command_builder
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
243 elif lrecord_type_p compiled_function; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
244 pstruct Lisp_Compiled_Function
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
245 elif lrecord_type_p console; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
246 pstruct console
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
247 elif lrecord_type_p database; then
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
248 pstruct Lisp_Database
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
249 elif lrecord_type_p device; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
250 pstruct device
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
251 elif lrecord_type_p event; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
252 pstruct Lisp_Event
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
253 elif lrecord_type_p extent; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
254 pstruct extent
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
255 elif lrecord_type_p extent_auxiliary; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
256 pstruct extent_auxiliary
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
257 elif lrecord_type_p extent_info; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
258 pstruct extent_info
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
259 elif lrecord_type_p face; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
260 pstruct Lisp_Face
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
261 elif lrecord_type_p float; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
262 pstruct Lisp_Float
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
263 elif lrecord_type_p font_instance; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
264 pstruct Lisp_Font_Instance
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
265 elif lrecord_type_p frame; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
266 pstruct frame
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
267 elif lrecord_type_p glyph; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
268 pstruct Lisp_Glyph
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
269 elif lrecord_type_p hash_table; then
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
270 pstruct Lisp_Hash_Table
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
271 elif lrecord_type_p image_instance; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
272 pstruct Lisp_Image_Instance
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
273 elif lrecord_type_p keymap; then
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
274 pstruct Lisp_Keymap
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
275 elif lrecord_type_p lcrecord_list; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
276 pstruct lcrecord_list
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
277 elif lrecord_type_p lstream; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
278 pstruct lstream
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
279 elif lrecord_type_p marker; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
280 pstruct Lisp_Marker
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
281 elif lrecord_type_p opaque; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
282 pstruct Lisp_Opaque
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
283 elif lrecord_type_p opaque_list; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
284 pstruct Lisp_Opaque_List
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
285 elif lrecord_type_p popup_data; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
286 pstruct popup_data
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
287 elif lrecord_type_p process; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
288 pstruct Lisp_Process
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
289 elif lrecord_type_p range_table; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
290 pstruct Lisp_Range_Table
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
291 elif lrecord_type_p specifier; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
292 pstruct Lisp_Specifier
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
293 elif lrecord_type_p subr; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
294 pstruct Lisp_Subr
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
295 elif lrecord_type_p symbol_value_buffer_local; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
296 pstruct symbol_value_buffer_local
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
297 elif lrecord_type_p symbol_value_forward; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
298 pstruct symbol_value_forward
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
299 elif lrecord_type_p symbol_value_lisp_magic; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
300 pstruct symbol_value_lisp_magic
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
301 elif lrecord_type_p symbol_value_varalias; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
302 pstruct symbol_value_varalias
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
303 elif lrecord_type_p toolbar_button; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
304 pstruct toolbar_button
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
305 elif lrecord_type_p tooltalk_message; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
306 pstruct Lisp_Tooltalk_Message
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
307 elif lrecord_type_p tooltalk_pattern; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
308 pstruct Lisp_Tooltalk_Pattern
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
309 elif lrecord_type_p weak_list; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
310 pstruct weak_list
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
311 elif lrecord_type_p window; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
312 pstruct window
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
313 elif lrecord_type_p window_configuration; then
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
314 pstruct window_config
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
315 elif test "$type" = "null_pointer"; then
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
316 echo "Lisp Object is a null pointer!!"
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
317 else
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
318 echo "Unknown Lisp Object type"
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
319 print $1
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
320 fi
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
321 }
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
322
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
323 function pproc {
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
324 print *(`process.c`struct Lisp_Process*)$1 ;
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
325 ldp "(`process.c`struct Lisp_Process*)$1->name" ;
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 2
diff changeset
326 ldp "(`process.c`struct Lisp_Process*)$1->command" ;
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
327 }
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
328
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
329 dbxenv suppress_startup_message 4.0
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 371
diff changeset
330 dbxenv mt_watchpoints on
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
331
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
332 function dp_core {
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
333 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
334 }
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
335
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
336 # Barf!
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
337 function print_shell {
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
338 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
339 }