Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | # |
2 | # Copyright 2007 Sun Microsystems, Inc. All rights reserved. | |
3 | # Use is subject to license terms. | |
4 | # | |
5 | #ident "@(#)dbxrc 1.8 07/05/30 SMI" | |
6 | # | |
7 | if [ -f $HOME/.dbxrc ]; then | |
8 | source $HOME/.dbxrc | |
9 | fi | |
10 | ||
11 | debug sim | |
12 | ||
13 | when in init_threads -temp { stop in debug_hook; } | |
14 | when in init_threads -temp { when in debug_hook { call debug_dump_pc(); }; } | |
15 | ||
16 | function simbreak | |
17 | { | |
18 | : ${1?"usage: $0 <pc> #set a simulation breakpoint at pc"} | |
19 | ||
20 | if [ $proc = 0 ]; then | |
21 | eval "when in init_threads -temp { call debug_set_breakpoint($1); }" | |
22 | else | |
23 | call debug_set_breakpoint($1) | |
24 | fi | |
25 | } | |
26 | ||
27 | function simclearbreak | |
28 | { | |
29 | : ${1?"usage: $0 <pc> #clear simulation breakpoint at pc"} | |
30 | ||
31 | if [ $proc = 0 ]; then | |
32 | eval "when in init_threads -temp { call debug_clear_breakpoint($1); }" | |
33 | else | |
34 | call debug_clear_breakpoint($1) | |
35 | fi | |
36 | } | |
37 | ||
38 | function simshowbreak | |
39 | { | |
40 | if [ $proc = 0 ]; then | |
41 | echo "dbx: sim not active" | |
42 | return | |
43 | fi | |
44 | ||
45 | call debug_print_breakpoints() | |
46 | ||
47 | } | |
48 | ||
49 | function simstep | |
50 | { | |
51 | [ -z "$2" ] || { echo "usage: $0 [<n>]" >&2 && return; } | |
52 | ||
53 | if [ $proc = 0 ]; then | |
54 | echo "dbx: sim not active" | |
55 | return | |
56 | fi | |
57 | ||
58 | if [ -z "$1" ]; then n=1; else n=$1; fi | |
59 | while [ $n -gt 0 ]; do | |
60 | call debug_set_breakpoint_next() | |
61 | cont | |
62 | ((n -= 1)) | |
63 | done | |
64 | } | |
65 | ||
66 | function simregs | |
67 | { | |
68 | if [ $proc = 0 ]; then | |
69 | echo "dbx: sim not active" | |
70 | return | |
71 | fi | |
72 | ||
73 | call debug_regs() | |
74 | } | |
75 | ||
76 | function simregsall | |
77 | { | |
78 | if [ $proc = 0 ]; then | |
79 | echo "dbx: sim not active" | |
80 | return | |
81 | fi | |
82 | ||
83 | call debug_regs_all() | |
84 | } | |
85 | ||
86 | function simmmuregs | |
87 | { | |
88 | if [ $proc = 0 ]; then | |
89 | echo "dbx: sim not active" | |
90 | return | |
91 | fi | |
92 | ||
93 | call debug_mmuregs() | |
94 | } | |
95 | ||
96 | function simmmuregsall | |
97 | { | |
98 | if [ $proc = 0 ]; then | |
99 | echo "dbx: sim not active" | |
100 | return | |
101 | fi | |
102 | ||
103 | call debug_mmuregs_all() | |
104 | } | |
105 | ||
106 | function simdumpdtlb | |
107 | { | |
108 | if [ $proc = 0 ]; then | |
109 | echo "dbx: sim not active" | |
110 | return | |
111 | fi | |
112 | ||
113 | call debug_dump_dtlb() | |
114 | } | |
115 | ||
116 | function simdumpdtlball | |
117 | { | |
118 | if [ $proc = 0 ]; then | |
119 | echo "dbx: sim not active" | |
120 | return | |
121 | fi | |
122 | ||
123 | call debug_dump_dtlb_all() | |
124 | } | |
125 | ||
126 | function simdumpitlb | |
127 | { | |
128 | if [ $proc = 0 ]; then | |
129 | echo "dbx: sim not active" | |
130 | return | |
131 | fi | |
132 | ||
133 | call debug_dump_itlb() | |
134 | } | |
135 | ||
136 | function simdumpitlball | |
137 | { | |
138 | if [ $proc = 0 ]; then | |
139 | echo "dbx: sim not active" | |
140 | return | |
141 | fi | |
142 | ||
143 | call debug_dump_itlb_all() | |
144 | } | |
145 | ||
146 | function simx | |
147 | { | |
148 | : ${1?"usage: $0 <paddr> [<n>]"} | |
149 | ||
150 | if [ $proc = 0 ]; then | |
151 | echo "dbx: sim not active" | |
152 | return | |
153 | fi | |
154 | ||
155 | if [ -z "$2" ]; then n=1; else n=$2; fi | |
156 | ||
157 | call debug_x($1, $n) | |
158 | } | |
159 | ||
160 | function simdis | |
161 | { | |
162 | : ${1?"usage: $0 <paddr> [<n>]"} | |
163 | ||
164 | if [ $proc = 0 ]; then | |
165 | echo "dbx: sim not active" | |
166 | return | |
167 | fi | |
168 | ||
169 | if [ -z "$2" ]; then n=1; else n=$2; fi | |
170 | ||
171 | call debug_dis($1, $n) | |
172 | } | |
173 | ||
174 | function simfocus | |
175 | { | |
176 | if [ $proc = 0 ]; then | |
177 | echo "dbx: sim not active" | |
178 | return | |
179 | fi | |
180 | ||
181 | if [ -z "$1" ]; then | |
182 | call debug_focus_show(); | |
183 | else | |
184 | call debug_focus_set($1); | |
185 | fi | |
186 | } | |
187 | ||
188 | function simtrans | |
189 | { | |
190 | : ${1?"usage: $0 <vaddr>"} | |
191 | ||
192 | if [ $proc = 0 ]; then | |
193 | echo "dbx: sim not active" | |
194 | return | |
195 | fi | |
196 | ||
197 | call debug_trans($1) | |
198 | } | |
199 | ||
200 | function simpc | |
201 | { | |
202 | if [ $proc = 0 ]; then | |
203 | echo "dbx: sim not active" | |
204 | return | |
205 | fi | |
206 | ||
207 | call debug_dump_pc() | |
208 | } | |
209 | ||
210 | function simpcall | |
211 | { | |
212 | if [ $proc = 0 ]; then | |
213 | echo "dbx: sim not active" | |
214 | return | |
215 | fi | |
216 | ||
217 | call debug_dump_pc_all() | |
218 | } | |
219 | ||
220 | function simscratch | |
221 | { | |
222 | if [ $proc = 0 ]; then | |
223 | echo "dbx: sim not active" | |
224 | return | |
225 | fi | |
226 | ||
227 | if [ -z "$1" ]; then | |
228 | call debug_print_scratch(-1) | |
229 | else | |
230 | call debug_print_scratch($1) | |
231 | fi | |
232 | } | |
233 | ||
234 | function simsave | |
235 | { | |
236 | if [ $proc = 0 ]; then | |
237 | echo "dbx: sim not active" | |
238 | return | |
239 | fi | |
240 | call debug_initiate_save_state_now() | |
241 | echo "type 'cont' on the debugger prompt for the save_state to begin" | |
242 | } | |
243 | ||
244 | function simicount | |
245 | { | |
246 | if [ $proc = 0 ]; then | |
247 | echo "dbx: sim not active" | |
248 | return | |
249 | fi | |
250 | call debug_print_icount() | |
251 | ||
252 | } | |
253 | ||
254 | function simcmpregs | |
255 | { | |
256 | if [ $proc = 0 ]; then | |
257 | echo "dbx: sim not active" | |
258 | return | |
259 | fi | |
260 | ||
261 | call debug_cmpregs() | |
262 | } | |
263 | ||
264 | function simdumpbreak | |
265 | { | |
266 | : ${1?"usage: $0 <fname> #dump breakpoints to file"} | |
267 | ||
268 | if [ $proc = 0 ]; then | |
269 | echo "dbx: sim not active" | |
270 | return | |
271 | fi | |
272 | ||
273 | call debug_dump_breakpoints($1) | |
274 | } | |
275 | ||
276 | function simrestorebreak | |
277 | { | |
278 | : ${1?"usage: $0 <fname> #restore breakpoints from file"} | |
279 | ||
280 | if [ $proc = 0 ]; then | |
281 | echo "dbx: sim not active" | |
282 | return | |
283 | fi | |
284 | ||
285 | call debug_restore_breakpoints($1) | |
286 | } |