/[cmucl]/src/tools/gdbinit-amd64
ViewVC logotype

Contents of /src/tools/gdbinit-amd64

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Mon Nov 22 16:53:05 2004 UTC (9 years, 4 months ago) by cwang
Branch: MAIN
CVS Tags: sparc-tramp-assem-base, double-double-array-base, post-merge-intl-branch, release-19b-pre1, release-19b-pre2, merged-unicode-utf16-extfmt-2009-06-11, double-double-init-sparc-2, unicode-utf16-extfmt-2009-03-27, double-double-base, snapshot-2007-09, snapshot-2007-08, snapshot-2008-08, snapshot-2008-09, ppc_gencgc_snap_2006-01-06, sse2-packed-2008-11-12, snapshot-2008-05, snapshot-2008-06, snapshot-2008-07, snapshot-2007-05, snapshot-2008-01, snapshot-2008-02, snapshot-2008-03, intl-branch-working-2010-02-19-1000, snapshot-2006-11, snapshot-2006-10, double-double-init-sparc, snapshot-2006-12, unicode-string-buffer-impl-base, sse2-base, release-20b-pre1, release-20b-pre2, unicode-string-buffer-base, sse2-packed-base, sparc-tramp-assem-2010-07-19, amd64-dd-start, release-19f-pre1, snapshot-2008-12, snapshot-2008-11, intl-2-branch-base, snapshot-2007-01, snapshot-2007-02, release-19e, release-19d, GIT-CONVERSION, double-double-init-ppc, release-19c, unicode-utf16-sync-2008-12, release-19c-base, cross-sol-x86-merged, label-2009-03-16, release-19f-base, merge-sse2-packed, merge-with-19f, snapshot-2004-12, intl-branch-working-2010-02-11-1000, unicode-snapshot-2009-05, unicode-snapshot-2009-06, ppc_gencgc_snap_2005-12-17, double-double-init-%make-sparc, unicode-utf16-sync-2008-07, unicode-utf16-sync-2008-09, unicode-utf16-extfmts-sync-2008-12, RELEASE_20b, snapshot-2008-04, snapshot-2005-07, unicode-utf16-sync-label-2009-03-16, RELEASE_19f, snapshot-2007-03, release-20a-base, cross-sol-x86-base, unicode-utf16-char-support-2009-03-26, unicode-utf16-char-support-2009-03-25, unicode-utf16-extfmts-pre-sync-2008-11, snapshot-2008-10, snapshot-2007-04, snapshot-2010-12, snapshot-2010-11, unicode-utf16-sync-2008-11, snapshot-2007-07, snapshot-2011-09, snapshot-2011-06, snapshot-2011-07, snapshot-2011-04, snapshot-2007-06, snapshot-2011-02, snapshot-2011-03, snapshot-2011-01, pre-merge-intl-branch, double-double-array-checkpoint, double-double-reader-checkpoint-1, release-19d-base, release-19e-pre1, double-double-irrat-end, release-19e-pre2, snapshot-2010-05, snapshot-2010-04, snapshot-2010-07, snapshot-2010-06, snapshot-2010-01, snapshot-2010-03, snapshot-2010-02, release-19d-pre2, release-19d-pre1, snapshot-2010-08, double-double-init-checkpoint-1, double-double-reader-base, label-2009-03-25, snapshot-2005-03, release-19b-base, cross-sol-x86-2010-12-20, double-double-init-x86, sse2-checkpoint-2008-10-01, intl-branch-2010-03-18-1300, snapshot-2005-11, double-double-sparc-checkpoint-1, sse2-merge-with-2008-11, sse2-merge-with-2008-10, snapshot-2005-10, RELEASE_20a, snapshot-2005-12, release-20a-pre1, snapshot-2005-01, snapshot-2009-11, snapshot-2009-12, unicode-utf16-extfmt-2009-06-11, portable-clx-import-2009-06-16, unicode-utf16-string-support, release-19c-pre1, cross-sparc-branch-base, release-19e-base, intl-branch-base, double-double-irrat-start, snapshot-2005-06, snapshot-2005-05, snapshot-2005-04, ppc_gencgc_snap_2005-05-14, snapshot-2005-02, unicode-utf16-base, portable-clx-base, snapshot-2005-09, snapshot-2005-08, snapshot-2009-08, snapshot-2007-12, snapshot-2007-10, snapshot-2007-11, snapshot-2009-02, snapshot-2009-01, snapshot-2009-07, snapshot-2009-05, snapshot-2009-04, snapshot-2006-02, snapshot-2006-03, snapshot-2006-01, snapshot-2006-06, snapshot-2006-07, snapshot-2006-04, snapshot-2006-05, pre-telent-clx, snapshot-2006-08, snapshot-2006-09, HEAD
Branch point for: release-19b-branch, double-double-reader-branch, double-double-array-branch, RELEASE-19F-BRANCH, portable-clx-branch, cross-sparc-branch, RELEASE-20B-BRANCH, unicode-string-buffer-branch, sparc-tramp-assem-branch, release-19d-branch, ppc_gencgc_branch, sse2-packed-branch, RELEASE-20A-BRANCH, amd64-dd-branch, double-double-branch, unicode-string-buffer-impl-branch, intl-branch, unicode-utf16-branch, cross-sol-x86-branch, release-19e-branch, sse2-branch, release-19c-branch, intl-2-branch, unicode-utf16-extfmt-branch
Fix args
1 ## CMUCL debugging commands
2 ## Copyright (C) 2003 andreas fuchs <asf@void.at>
3 ## No warranty whatsoever (if applicable).
4 ## Do whatever you want with this code.
5
6 ## Install by copying it to /path/to/cmucl-source/lisp/.gdbinit
7
8 ## Usage:
9 ## See http://sbcl-internals.cliki.net/gdb
10
11 ## most of these functions are tested on amd64 only. Please tell me
12 ## about results you get when trying on other architectures.
13
14 define hookpost-stepi
15 y
16 disasm_from
17 end
18 document hookpost-stepi
19 workaround for gdb strangeness. it won't print the disassembled
20 current insn, but a unusable line number in a nonexistent file.
21 end
22
23 define hookpost-nexti
24 y
25 disasm_from
26 end
27 document hookpost-nexti
28 workaround for gdb strangeness. it won't print the disassembled
29 current insn, but a unusable line number in a nonexistent file.
30 end
31
32 set $SYM_NIL = 0
33
34 define initialize
35 y
36 printf "finding symbol nil from "
37 call lookup_by_name ("nil")
38 set $SYM_NIL = ((struct code*) $)->header
39 printf "nil found at value 0x%x\n", $SYM_NIL
40 end
41 document initialize
42 initialize the value of $SYM_NIL to the real NIL symbol.
43 end
44
45
46 define hookpost-attach
47 y
48 #initialize
49 end
50 document hookpost-attach
51 call the initialization function
52 end
53
54 define hookpost-run
55 y
56 initialize
57 end
58 document hookpost-run
59 call the initialization function
60 end
61
62 set $N_LOWTAG_BITS = 3
63 set $LOWTAG_MASK = ((1<<$N_LOWTAG_BITS)-1)
64
65 define y
66 end
67 document y
68 convenience function: "y"es we want to redefine the command.
69 end
70
71 define id_lowtag
72 y
73 printf "Lowtag of 0x%x: 0x%x (%s)\n", $arg0, $arg0 & 7, lowtag_Names[$arg0 & 7]
74 end
75 document id_lowtag
76 identify the lowtag of the first arg (a lisp pointer)
77 end
78
79 define xlisp
80 y
81 # list lowtag
82 if (($ & $LOWTAG_MASK) == 0x3)
83 print/x * ((struct cons*) ($ & ~$LOWTAG_MASK))
84 # function lowtag
85 else
86 if (($ & $LOWTAG_MASK) == 0x1)
87 printf "0x%x is a function.\n", $
88 print/x * ((struct function *) ($ & ~$LOWTAG_MASK))
89 printf "name of function follows:\n"
90 print/x $.name
91 xlisp
92 else
93 if (($ & $LOWTAG_MASK) == 0x4)
94 printf "0x%x is an (odd) fixnum: ", $
95 print ($ >> ($N_LOWTAG_BITS-1))
96 else
97 if (($ & $LOWTAG_MASK) == 0)
98 printf "0x%x is an (even) fixnum: ", $
99 print ($ >> ($N_LOWTAG_BITS-1))
100 else
101 # assume it's a symbol
102 if (($ & $LOWTAG_MASK) == 7)
103 printf "0x%x is a symbol.\n", $
104 print/x *((struct symbol *) ($ & ~$LOWTAG_MASK))
105 printf "name of symbol follows:\n"
106 x/s $.name + 9
107 else
108 printf "Unknown lowtag when printing 0x%x: 0x%x.\n", $, $ & $LOWTAG_MASK
109 end
110 end
111 end
112 end
113 end
114 end
115 document xlisp
116 examine the last (or second-to-last) lisp object.
117 Currently, only functions and cons cells are supported.
118 end
119
120 define xlispa
121 y
122 printf "examining "
123 print/x $arg0
124 xlisp
125 end
126 document xlispa
127 examine the first argument with xlisp.
128 end
129
130
131 define xcar
132 y
133 print/x $.car
134 xlisp
135 end
136 document xcar
137 examine the CAR of the last object (assuming it was of type
138 struct cons).
139 end
140
141 define xcdr
142 y
143 print/x $.cdr
144 xlisp
145 end
146 document xcdr
147 examine the CDR of the last object (assuming it was of type
148 struct cons).
149 end
150
151 define find_lispfunction
152 y
153 printf "searching for address 0x%x: found ", $arg0
154 call component_ptr_from_pc($arg0)
155 printf "this object is probably a 'code' object...\n"
156 print/x * ((struct code*) $)
157 printf "trying 'entry_points' (i.e. a chain of functions): "
158 print/x $.entry_points
159 xlisp
160 while $.next != $SYM_NIL
161 $this_function = $
162 printf "next function: "
163 print/x $this_function.next
164 xcar
165 print/x $this_function
166 xcdr
167 end
168 end
169 document find_lispfunction
170 find function names of objects of which we know only a $PC address.
171 This function uses heuristics to find and display the entry points.
172 end
173
174 define disasm_from
175 y
176 disassemble $pc $pc+24
177 end
178 document disasm_from
179 disassemble the block of memory starting from $pc, for lack of a
180 useful disassembly routine.
181 end
182
183
184 set print pretty on
185
186 # antifuchs's debugging routine
187
188
189 define onwards
190 y
191 set go=1
192 cont
193 end
194
195 define spinattach
196 y
197 while 1
198 attach $arg0
199 end
200 end
201
202
203 set args -core lisp.core
204 #handle SIGTRAP pass
205 #handle SIGBUS pass

  ViewVC Help
Powered by ViewVC 1.1.5