author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 18 Jul 2011 16:22:09 +0100 | |
branch | jv |
changeset 17846 | 24edc476ac18 |
parent 17845 | 7e0cfaac936d |
child 17865 | 598963c6ff8e |
permissions | -rw-r--r-- |
1 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1988 by Claus Gittinger |
159 | 3 |
All Rights Reserved |
1 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
5942
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
12 |
"{ Package: 'stx:libbasic' }" |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
13 |
|
720 | 14 |
Object subclass:#MiniDebugger |
5802
93748287026d
better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents:
5054
diff
changeset
|
15 |
instanceVariableNames:'tracing stepping traceBlock command commandArg commandCount |
5942
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
16 |
enteringContext dot nesting' |
976 | 17 |
classVariableNames:'TheOneAndOnlyDebugger' |
18 |
poolDictionaries:'' |
|
19 |
category:'System-Debugging-Support' |
|
1 | 20 |
! |
21 |
||
618 | 22 |
!MiniDebugger class methodsFor:'documentation'! |
89 | 23 |
|
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1988 by Claus Gittinger |
|
159 | 27 |
All Rights Reserved |
1 | 28 |
|
89 | 29 |
This software is furnished under a license and may be used |
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
1 | 37 |
|
89 | 38 |
documentation |
39 |
" |
|
40 |
a primitive (non graphical) debugger for use on systems without |
|
41 |
graphics or when the real debugger dies (i.e. an error occurs in |
|
42 |
the graphical debugger). |
|
93 | 43 |
Also, if an interrupt occurs within the debuger, this one is called |
44 |
for. |
|
1297 | 45 |
|
46 |
[author:] |
|
8840 | 47 |
Claus Gittinger |
89 | 48 |
" |
49 |
! ! |
|
1 | 50 |
|
618 | 51 |
!MiniDebugger class methodsFor:'instance creation'! |
52 |
||
11534 | 53 |
enter |
54 |
"enter a miniDebugger" |
|
55 |
||
56 |
^ self |
|
57 |
enter:thisContext sender |
|
58 |
withMessage:'MiniDebugger' |
|
59 |
mayProceed:true |
|
60 |
! |
|
61 |
||
4572 | 62 |
enter:aContext withMessage:aString mayProceed:mayProceed |
3814
1227e4690753
allow aborting other threads
Claus Gittinger <cg@exept.de>
parents:
3769
diff
changeset
|
63 |
"enter a miniDebugger" |
1227e4690753
allow aborting other threads
Claus Gittinger <cg@exept.de>
parents:
3769
diff
changeset
|
64 |
|
7839
d6d9fac8b4db
skip recursive contexts when shwing backtrace
Claus Gittinger <cg@exept.de>
parents:
7706
diff
changeset
|
65 |
|active con sender| |
618 | 66 |
|
67 |
StepInterruptPending := nil. |
|
68 |
||
7093
60bad14d38fc
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
6938
diff
changeset
|
69 |
Error handle:[:ex | |
8840 | 70 |
ex return |
2661
fea131f9f062
care for recursive errors in MiniDebugger
Claus Gittinger <cg@exept.de>
parents:
2118
diff
changeset
|
71 |
] do:[ |
8840 | 72 |
thisContext isRecursive ifTrue:[ |
73 |
"/ 'recursive error in debugger ignored' errorPrintCR. |
|
74 |
^ self |
|
75 |
]. |
|
76 |
aString printCR. |
|
77 |
Processor notNil ifTrue:[ |
|
78 |
active := Processor activeProcess. |
|
79 |
'process: id=' print. active id print. |
|
80 |
' name=' print. active name printCR. |
|
4960 | 81 |
|
8840 | 82 |
'context: ' print. aContext printString printCR. |
83 |
(con := aContext) notNil ifTrue:[ |
|
84 |
con := con sender. |
|
85 |
' ......: ' print. con printString printCR. |
|
86 |
[con notNil] whileTrue:[ |
|
87 |
sender := con sender. |
|
88 |
(sender notNil and:[sender selector == con selector]) ifTrue:[ |
|
89 |
' ......: ' print. sender printString printCR. |
|
90 |
' ......: [** intermediate recursive contexts skipped **]' printCR. |
|
91 |
[sender notNil |
|
92 |
and:[sender selector == con selector |
|
93 |
and:[sender method == con method]]] whileTrue:[ |
|
94 |
con := sender. |
|
95 |
sender := con sender. |
|
96 |
]. |
|
97 |
]. |
|
98 |
con := sender. |
|
99 |
' ......: ' print. con printString printCR. |
|
100 |
] |
|
101 |
] |
|
102 |
]. |
|
618 | 103 |
]. |
4209
7c1b4df9e555
care for noConsole present (WIN32 only)
Claus Gittinger <cg@exept.de>
parents:
4003
diff
changeset
|
104 |
|
7c1b4df9e555
care for noConsole present (WIN32 only)
Claus Gittinger <cg@exept.de>
parents:
4003
diff
changeset
|
105 |
OperatingSystem hasConsole ifFalse:[ |
8840 | 106 |
Error handle:[:ex | |
107 |
ex return |
|
108 |
] do:[ |
|
109 |
self warn:('Unexpected error:\' , aString , '\\No MiniDebugger functionality available') withCRs . |
|
110 |
]. |
|
4209
7c1b4df9e555
care for noConsole present (WIN32 only)
Claus Gittinger <cg@exept.de>
parents:
4003
diff
changeset
|
111 |
|
8840 | 112 |
Error handle:[:ex | |
113 |
'cannot raise Abort - exiting ...' errorPrintCR. |
|
114 |
Smalltalk exit. |
|
115 |
] do:[ |
|
116 |
AbortOperationRequest raise. |
|
117 |
] |
|
4209
7c1b4df9e555
care for noConsole present (WIN32 only)
Claus Gittinger <cg@exept.de>
parents:
4003
diff
changeset
|
118 |
] ifTrue:[ |
8840 | 119 |
self new enter:aContext mayProceed:mayProceed. |
4209
7c1b4df9e555
care for noConsole present (WIN32 only)
Claus Gittinger <cg@exept.de>
parents:
4003
diff
changeset
|
120 |
]. |
4961
5419c9a32316
abort after unproceedable error
Stefan Vogel <sv@exept.de>
parents:
4960
diff
changeset
|
121 |
mayProceed ifFalse:[ |
8840 | 122 |
AbortOperationRequest raise |
4961
5419c9a32316
abort after unproceedable error
Stefan Vogel <sv@exept.de>
parents:
4960
diff
changeset
|
123 |
]. |
618 | 124 |
^ nil |
1424 | 125 |
|
4209
7c1b4df9e555
care for noConsole present (WIN32 only)
Claus Gittinger <cg@exept.de>
parents:
4003
diff
changeset
|
126 |
"Modified: / 19.5.1999 / 18:14:33 / cg" |
618 | 127 |
! |
1 | 128 |
|
11235 | 129 |
enterException:ex |
130 |
"enter a debugger; if this is a recursive invocation, enter |
|
131 |
a MiniDebugger instead. |
|
132 |
This is the standard way of entering the debugger; |
|
133 |
sent from error- and halt messages." |
|
134 |
||
135 |
^ self |
|
136 |
enter:ex returnableSuspendedContext |
|
137 |
withMessage:ex descriptionForDebugger |
|
138 |
mayProceed:(ex mayProceed). |
|
139 |
! |
|
140 |
||
4572 | 141 |
enterWithMessage:aString mayProceed:mayProceed |
142 |
"enter a miniDebugger" |
|
143 |
||
11235 | 144 |
^ self |
145 |
enter:thisContext sender |
|
146 |
withMessage:aString |
|
147 |
mayProceed:mayProceed |
|
4572 | 148 |
|
149 |
"Modified: / 19.5.1999 / 18:14:33 / cg" |
|
150 |
! |
|
151 |
||
1 | 152 |
new |
3814
1227e4690753
allow aborting other threads
Claus Gittinger <cg@exept.de>
parents:
3769
diff
changeset
|
153 |
"redefined to make certain that there is only one miniDebugger |
1227e4690753
allow aborting other threads
Claus Gittinger <cg@exept.de>
parents:
3769
diff
changeset
|
154 |
in the system" |
1227e4690753
allow aborting other threads
Claus Gittinger <cg@exept.de>
parents:
3769
diff
changeset
|
155 |
|
5802
93748287026d
better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents:
5054
diff
changeset
|
156 |
^ self basicNew initialize. |
93748287026d
better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents:
5054
diff
changeset
|
157 |
|
5942
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
158 |
"/ TheOneAndOnlyDebugger isNil ifTrue:[ |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
159 |
"/ TheOneAndOnlyDebugger := self basicNew initialize |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
160 |
"/ ]. |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
161 |
"/ ^ TheOneAndOnlyDebugger |
1424 | 162 |
|
3700 | 163 |
" |
164 |
TheOneAndOnlyDebugger := nil |
|
165 |
" |
|
166 |
||
3701 | 167 |
"Modified: / 31.7.1998 / 17:08:07 / cg" |
1 | 168 |
! |
169 |
||
4966 | 170 |
openOn:aProcess |
171 |
"enter a miniDebugger" |
|
172 |
||
8840 | 173 |
^ self |
174 |
enter:thisContext sender |
|
175 |
withMessage:'MiniDebugger [info]: Attention - process debugging not possible.' |
|
176 |
mayProceed:true |
|
4966 | 177 |
|
178 |
"Modified: / 19.5.1999 / 18:14:33 / cg" |
|
179 |
! |
|
180 |
||
1 | 181 |
singleStep:aBlock |
182 |
|aDebugger| |
|
183 |
||
184 |
aDebugger := self new stepping. |
|
241 | 185 |
ObjectMemory stepInterruptHandler:aDebugger. |
2 | 186 |
ObjectMemory flushInlineCaches. |
241 | 187 |
StepInterruptPending := 1. |
188 |
InterruptPending := 1. |
|
1 | 189 |
aBlock value. |
2 | 190 |
StepInterruptPending := nil. |
191 |
ObjectMemory stepInterruptHandler:nil |
|
1 | 192 |
! |
193 |
||
194 |
trace:aBlock |
|
1424 | 195 |
self trace:aBlock with:[:where | where printCR] |
196 |
||
197 |
"Modified: 20.5.1996 / 10:27:37 / cg" |
|
1 | 198 |
! |
199 |
||
200 |
trace:aBlock on:aStream |
|
201 |
self trace:aBlock with:[:where | where printString printOn:aStream. |
|
159 | 202 |
aStream cr] |
1 | 203 |
! |
204 |
||
205 |
trace:aBlock with:aTraceBlock |
|
206 |
|aDebugger| |
|
207 |
||
208 |
aDebugger := self new tracingWith:aTraceBlock. |
|
241 | 209 |
ObjectMemory stepInterruptHandler:aDebugger. |
1 | 210 |
ObjectMemory flushInlineCaches. |
241 | 211 |
StepInterruptPending := 1. |
212 |
InterruptPending := 1. |
|
1 | 213 |
aBlock value. |
2 | 214 |
ObjectMemory stepInterruptHandler:nil. |
1 | 215 |
StepInterruptPending := nil. |
216 |
^ nil |
|
217 |
! ! |
|
218 |
||
618 | 219 |
!MiniDebugger methodsFor:'initialization'! |
1 | 220 |
|
221 |
initialize |
|
222 |
traceBlock := nil. |
|
223 |
tracing := false. |
|
224 |
stepping := false |
|
225 |
! ! |
|
226 |
||
618 | 227 |
!MiniDebugger methodsFor:'interrupt handling'! |
1 | 228 |
|
5802
93748287026d
better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents:
5054
diff
changeset
|
229 |
enter:aContext mayProceed:mayProceed |
93748287026d
better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents:
5054
diff
changeset
|
230 |
|c leaveCmd stillHere yesNo| |
93748287026d
better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents:
5054
diff
changeset
|
231 |
|
93748287026d
better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents:
5054
diff
changeset
|
232 |
enteringContext := dot := aContext. |
93748287026d
better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents:
5054
diff
changeset
|
233 |
nesting := 0. |
93748287026d
better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents:
5054
diff
changeset
|
234 |
c := aContext. |
93748287026d
better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents:
5054
diff
changeset
|
235 |
[c notNil] whileTrue:[ |
10374 | 236 |
c selector == #enter:mayProceed: ifTrue:[ |
237 |
nesting := nesting + 1. |
|
238 |
]. |
|
239 |
c := c sender. |
|
5802
93748287026d
better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents:
5054
diff
changeset
|
240 |
]. |
74 | 241 |
|
242 |
stillHere := true. |
|
243 |
[stillHere] whileTrue:[ |
|
10374 | 244 |
AbortOperationRequest handle:[:ex | |
245 |
'** Abort cought - back in previous debugLevel' printCR. |
|
246 |
] do:[ |
|
247 |
Error handle:[:ex | |
|
248 |
'Error while executing command: ' print. |
|
249 |
ex description printCR. |
|
250 |
yesNo := self getCommand:'- (i)gnore / (p)roceed / (d)ebug / b(acktrace) ? '. |
|
251 |
yesNo == $d ifTrue:[ |
|
252 |
MiniDebugger enterWithMessage:'Debugging debugger' mayProceed:true. |
|
253 |
ex proceed |
|
254 |
]. |
|
255 |
yesNo == $p ifTrue:[ |
|
256 |
ex proceed |
|
257 |
]. |
|
258 |
yesNo == $b ifTrue:[ |
|
259 |
ex suspendedContext fullPrintAll. |
|
260 |
ex proceed |
|
261 |
]. |
|
262 |
] do:[ |
|
263 |
[ |
|
264 |
leaveCmd := self commandLoop. |
|
265 |
] valueUnpreemptively. |
|
266 |
]. |
|
267 |
]. |
|
1 | 268 |
|
10374 | 269 |
(leaveCmd == $s) ifTrue: [ |
270 |
self stepping. |
|
271 |
ObjectMemory flushInlineCaches. |
|
272 |
ObjectMemory stepInterruptHandler:self. |
|
273 |
stillHere := false. |
|
274 |
StepInterruptPending := 1. |
|
275 |
InterruptPending := 1 |
|
276 |
]. |
|
277 |
(leaveCmd == $t) ifTrue: [ |
|
278 |
traceBlock := [:where | where fullPrint]. |
|
279 |
ObjectMemory flushInlineCaches. |
|
280 |
ObjectMemory stepInterruptHandler:self. |
|
281 |
stillHere := false. |
|
282 |
StepInterruptPending := 1. |
|
283 |
InterruptPending := 1 |
|
284 |
]. |
|
285 |
(leaveCmd == $c) ifTrue: [ |
|
286 |
traceBlock := nil. |
|
287 |
stillHere := false. |
|
288 |
stepping := false. |
|
289 |
tracing := false. |
|
290 |
StepInterruptPending := nil. |
|
291 |
InterruptPending := nil |
|
292 |
]. |
|
293 |
(leaveCmd == $a) ifTrue: [ |
|
294 |
"abort" |
|
295 |
stepping := false. |
|
296 |
tracing := false. |
|
297 |
StepInterruptPending := nil. |
|
298 |
InterruptPending := nil. |
|
299 |
self doAbort. |
|
300 |
stillHere := true. |
|
301 |
"failed abort" |
|
302 |
]. |
|
1 | 303 |
]. |
5802
93748287026d
better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents:
5054
diff
changeset
|
304 |
enteringContext := dot := nil. |
1 | 305 |
^ nil |
3769 | 306 |
|
307 |
"Modified: / 18.8.1998 / 18:10:29 / cg" |
|
618 | 308 |
! |
309 |
||
310 |
stepInterrupt |
|
311 |
|where| |
|
312 |
||
313 |
where := thisContext. "where is stepInterrupt context" |
|
314 |
where notNil ifTrue:[ |
|
8840 | 315 |
where := where sender "where is now interrupted methods context" |
618 | 316 |
]. |
317 |
stepping ifTrue:[ |
|
8840 | 318 |
where notNil ifTrue:[ |
319 |
where fullPrint |
|
320 |
] ifFalse:[ |
|
321 |
'stepInterrupt: no context' errorPrintCR |
|
322 |
]. |
|
323 |
self enter:where mayProceed:true |
|
618 | 324 |
] ifFalse:[ |
8840 | 325 |
where notNil ifTrue:[ |
326 |
traceBlock notNil ifTrue:[ |
|
327 |
traceBlock value:where |
|
328 |
] |
|
329 |
] ifFalse:[ |
|
330 |
'traceInterrupt: no context' errorPrintCR |
|
331 |
]. |
|
332 |
ObjectMemory flushInlineCaches. |
|
333 |
StepInterruptPending := 1. |
|
334 |
InterruptPending := 1 |
|
618 | 335 |
] |
1424 | 336 |
|
337 |
"Modified: 20.5.1996 / 10:23:11 / cg" |
|
1 | 338 |
! ! |
339 |
||
618 | 340 |
!MiniDebugger methodsFor:'private'! |
74 | 341 |
|
618 | 342 |
findContext:aSelector |
343 |
|con| |
|
74 | 344 |
|
618 | 345 |
con := thisContext sender. |
346 |
[con notNil] whileTrue:[ |
|
347 |
(con isBlockContext not and:[con selector == aSelector]) ifTrue:[ |
|
348 |
"got it" |
|
349 |
^ con |
|
350 |
]. |
|
351 |
con := con sender |
|
74 | 352 |
]. |
618 | 353 |
^ nil |
74 | 354 |
! |
355 |
||
7701 | 356 |
garbageCollectCommand:id |
357 |
id == 3 ifTrue:[ |
|
8840 | 358 |
ObjectMemory reclaimSymbols. |
359 |
ObjectMemory compressOldSpace. |
|
7701 | 360 |
] ifFalse:[ |
8840 | 361 |
id == 2 ifTrue:[ |
362 |
ObjectMemory reclaimSymbols. |
|
363 |
] ifFalse:[ |
|
364 |
ObjectMemory garbageCollect. |
|
365 |
] |
|
7701 | 366 |
] |
367 |
! |
|
368 |
||
618 | 369 |
getContext |
370 |
|backtrace| |
|
371 |
backtrace := thisContext. |
|
372 |
(backtrace notNil) ifTrue: [ |
|
373 |
"remove Context getContext frame" |
|
374 |
backtrace := backtrace sender. |
|
375 |
"remove Debugger showContext frame" |
|
376 |
backtrace := backtrace sender. |
|
377 |
"remove Debugger commandLoop frame" |
|
378 |
backtrace := backtrace sender. |
|
379 |
"remove Debugger enter frame" |
|
380 |
backtrace := backtrace sender |
|
381 |
]. |
|
382 |
^ backtrace |
|
383 |
! |
|
74 | 384 |
|
5942
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
385 |
moveDotDown |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
386 |
"/ sigh - must search |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
387 |
|c| |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
388 |
|
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
389 |
c := enteringContext. |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
390 |
[ c notNil and:[ c sender ~~ dot ] ] whileTrue:[ |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
391 |
c := c sender. |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
392 |
]. |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
393 |
c notNil ifTrue:[ |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
394 |
dot := c. |
8717 | 395 |
dot fullPrint. |
5942
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
396 |
] ifFalse:[ |
8840 | 397 |
'** dot is the bottom of the calling chain' printCR. |
5942
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
398 |
]. |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
399 |
! |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
400 |
|
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
401 |
moveDotUp |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
402 |
dot sender notNil ifTrue:[ |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
403 |
dot := dot sender. |
8717 | 404 |
dot fullPrint. |
5942
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
405 |
] ifFalse:[ |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
406 |
'** dot is the top of the calling chain' printCR. |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
407 |
]. |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
408 |
! |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
409 |
|
2772 | 410 |
printBacktraceFrom:aContext |
4003
d0f97b9cd4de
added 'S' -> stopp a process
Claus Gittinger <cg@exept.de>
parents:
3814
diff
changeset
|
411 |
|context n| |
d0f97b9cd4de
added 'S' -> stopp a process
Claus Gittinger <cg@exept.de>
parents:
3814
diff
changeset
|
412 |
|
d0f97b9cd4de
added 'S' -> stopp a process
Claus Gittinger <cg@exept.de>
parents:
3814
diff
changeset
|
413 |
aContext isNil ifTrue:[ |
8840 | 414 |
'no context' errorPrintCR. |
415 |
^ self |
|
4003
d0f97b9cd4de
added 'S' -> stopp a process
Claus Gittinger <cg@exept.de>
parents:
3814
diff
changeset
|
416 |
]. |
d0f97b9cd4de
added 'S' -> stopp a process
Claus Gittinger <cg@exept.de>
parents:
3814
diff
changeset
|
417 |
|
d0f97b9cd4de
added 'S' -> stopp a process
Claus Gittinger <cg@exept.de>
parents:
3814
diff
changeset
|
418 |
context := aContext. |
d0f97b9cd4de
added 'S' -> stopp a process
Claus Gittinger <cg@exept.de>
parents:
3814
diff
changeset
|
419 |
n := commandCount. |
d0f97b9cd4de
added 'S' -> stopp a process
Claus Gittinger <cg@exept.de>
parents:
3814
diff
changeset
|
420 |
[context notNil] whileTrue: [ |
8840 | 421 |
context fullPrint. |
422 |
context := context sender. |
|
423 |
n notNil ifTrue:[ |
|
424 |
n := n - 1. |
|
425 |
n <= 0 ifTrue:[ |
|
426 |
^ self |
|
427 |
] |
|
428 |
] |
|
2772 | 429 |
] |
430 |
! |
|
431 |
||
5942
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
432 |
printDot |
8717 | 433 |
dot fullPrint. |
434 |
'receiver: ' print. dot receiver printCR. |
|
435 |
'selector: ' print. dot selector printCR. |
|
436 |
'args: ' printCR. |
|
437 |
dot args keysAndValuesDo:[:idx :eachArg | |
|
8840 | 438 |
' ' print. idx print. ': ' print. eachArg printCR. |
8717 | 439 |
]. |
440 |
'vars: ' printCR. |
|
441 |
dot vars keysAndValuesDo:[:idx :eachVar | |
|
8840 | 442 |
' ' print. idx print. ': ' print. eachVar printCR. |
8717 | 443 |
]. |
444 |
! |
|
445 |
||
446 |
printDotsMethodSource |
|
8840 | 447 |
|home mthd src| |
8717 | 448 |
|
449 |
home := dot methodHome. |
|
450 |
mthd := home method. |
|
451 |
mthd isNil ifTrue:[ |
|
8840 | 452 |
'** no source **' printCR. |
8717 | 453 |
^ self. |
454 |
]. |
|
455 |
src := mthd source. |
|
456 |
src isNil ifTrue:[ |
|
8840 | 457 |
'** no source **' printCR. |
8717 | 458 |
^ self. |
459 |
]. |
|
460 |
src := src asCollectionOfLines. |
|
461 |
src keysAndValuesDo:[:lNr :line | |
|
462 |
lNr == dot lineNumber ifTrue:[ |
|
463 |
'>> ' print. |
|
464 |
] ifFalse:[ |
|
465 |
' ' print. |
|
466 |
]. |
|
8840 | 467 |
line printCR. |
8717 | 468 |
] |
5942
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
469 |
! |
e3431a2c33f1
avoid statements after return
Claus Gittinger <cg@exept.de>
parents:
5921
diff
changeset
|
470 |
|
618 | 471 |
stepping |
472 |
traceBlock := nil. |
|
473 |
tracing := false. |
|
474 |
stepping := true |
|
74 | 475 |
! |
476 |
||
618 | 477 |
tracingWith:aBlockOrNil |
478 |
traceBlock := aBlockOrNil. |
|
479 |
stepping := false. |
|
480 |
tracing := true |
|
481 |
! ! |
|
482 |
||
483 |
!MiniDebugger methodsFor:'user commands'! |
|
484 |
||
1 | 485 |
commandLoop |
3700 | 486 |
|cmd done valid context id proc| |
1 | 487 |
|
488 |
done := false. |
|
489 |
[done] whileFalse:[ |
|
10017 | 490 |
valid := false. |
491 |
cmd := self getCommand:nil. |
|
492 |
cmd isNil ifTrue:[ "/ EOF -> continue |
|
493 |
cmd := $c |
|
494 |
]. |
|
3700 | 495 |
|
10017 | 496 |
commandArg notEmpty ifTrue:[ |
497 |
id := Number readFrom:commandArg onError:nil. |
|
3700 | 498 |
|
10017 | 499 |
id notNil ifTrue:[ |
500 |
proc := Process allSubInstances detect:[:p | p id == id] ifNone:nil. |
|
501 |
proc == Processor activeProcess ifTrue:[ |
|
502 |
id := proc := nil |
|
503 |
] |
|
504 |
] |
|
505 |
]. |
|
3700 | 506 |
|
10017 | 507 |
(cmd == $l) ifTrue:[ |
508 |
valid := true. |
|
509 |
proc notNil ifTrue:[ |
|
510 |
'-------- walkback of process ' print. id print. ' -------' printCR. |
|
511 |
self printBacktraceFrom:(proc suspendedContext) |
|
512 |
] ifFalse:[ |
|
513 |
id notNil ifTrue:[ |
|
514 |
'no process with id: ' print. id printCR. |
|
515 |
] ifFalse:[ |
|
516 |
context isNil ifTrue: [ |
|
517 |
context := self getContext |
|
518 |
]. |
|
519 |
'-------- walkback of current process -------' printCR. |
|
520 |
self printBacktraceFrom:context |
|
521 |
] |
|
522 |
]. |
|
523 |
]. |
|
3700 | 524 |
|
10017 | 525 |
(cmd == $b) ifTrue:[ |
526 |
valid := true. |
|
527 |
proc notNil ifTrue:[ |
|
528 |
'-------- VM walkback of process ' print. id print. ' -------' printCR. |
|
529 |
ObjectMemory printStackBacktraceFrom:(proc suspendedContext) |
|
530 |
] ifFalse:[ |
|
531 |
id notNil ifTrue:[ |
|
532 |
'no process with id: ' print. id printCR. |
|
533 |
] ifFalse:[ |
|
534 |
'-------- VM walkback of current process -------' printCR. |
|
535 |
ObjectMemory printStackBacktrace |
|
536 |
] |
|
537 |
] |
|
538 |
]. |
|
3700 | 539 |
|
10017 | 540 |
(cmd == $S) ifTrue:[ |
541 |
valid := true. |
|
542 |
'saving "crash.img"...' print. |
|
543 |
ObjectMemory writeCrashImage. |
|
544 |
'done.' printCR. |
|
545 |
]. |
|
5802
93748287026d
better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents:
5054
diff
changeset
|
546 |
|
10017 | 547 |
(cmd == $B) ifTrue:[ |
548 |
valid := true. |
|
549 |
self printAllBacktraces |
|
550 |
]. |
|
3700 | 551 |
|
10017 | 552 |
(cmd == $P) ifTrue:[ |
553 |
valid := true. |
|
554 |
self showProcesses. |
|
555 |
]. |
|
3700 | 556 |
|
10017 | 557 |
(cmd == $r) ifTrue:[ |
558 |
valid := true. |
|
559 |
dot receiver printCR |
|
560 |
]. |
|
3700 | 561 |
|
10017 | 562 |
(cmd == $i) ifTrue:[ |
563 |
valid := true. |
|
564 |
MiniInspector openOn:(dot receiver) |
|
565 |
]. |
|
3700 | 566 |
|
10017 | 567 |
(cmd == $I) ifTrue:[ |
568 |
valid := true. |
|
569 |
self interpreterLoopWith:nil |
|
570 |
]. |
|
17807 | 571 |
(cmd == $e) ifTrue:[ |
572 |
valid := true. |
|
573 |
Parser evaluate:commandArg. |
|
574 |
]. |
|
575 |
||
10017 | 576 |
context := nil. |
3009 | 577 |
|
10017 | 578 |
(cmd == $c) ifTrue:[valid := true. done := true]. |
579 |
(cmd == $s) ifTrue:[valid := true. done := true]. |
|
580 |
(cmd == $t) ifTrue:[valid := true. done := true]. |
|
581 |
(cmd == $a) ifTrue:[valid := true. done := true]. |
|
582 |
(cmd == $u) ifTrue:[ |
|
583 |
stepping := false. |
|
584 |
tracing := false. |
|
585 |
Processor activeProcess vmTrace:false. |
|
586 |
]. |
|
3700 | 587 |
|
10017 | 588 |
(cmd == $R) ifTrue:[ |
589 |
valid := true. |
|
590 |
proc notNil ifTrue:[ |
|
591 |
proc resume. |
|
592 |
] |
|
593 |
]. |
|
6938 | 594 |
|
10017 | 595 |
(cmd == $T) ifTrue:[ |
596 |
valid := true. |
|
597 |
proc notNil ifTrue:[ |
|
598 |
proc terminate. |
|
599 |
] ifFalse:[ |
|
600 |
id notNil ifTrue:[ |
|
601 |
'no process with id: ' print. id printCR. |
|
602 |
] ifFalse:[ |
|
603 |
Processor terminateActive |
|
604 |
] |
|
605 |
] |
|
606 |
]. |
|
3700 | 607 |
|
10017 | 608 |
(cmd == $W) ifTrue:[ |
609 |
valid := true. |
|
610 |
proc notNil ifTrue:[ |
|
611 |
'stopping process id: ' print. id printCR. |
|
612 |
proc stop. |
|
613 |
] ifFalse:[ |
|
614 |
'invalid process id: ' print. id printCR. |
|
615 |
] |
|
616 |
]. |
|
4003
d0f97b9cd4de
added 'S' -> stopp a process
Claus Gittinger <cg@exept.de>
parents:
3814
diff
changeset
|
617 |
|
10017 | 618 |
(cmd == $a) ifTrue:[ |
619 |
"without id-arg, this is handled by caller" |
|
620 |
proc notNil ifTrue:[ |
|
621 |
'aborting process id: ' print. id printCR. |
|
622 |
valid := true. |
|
623 |
proc interruptWith:[AbortOperationRequest raise] |
|
624 |
] ifFalse:[ |
|
625 |
'aborting' printCR. |
|
626 |
] |
|
627 |
]. |
|
3814
1227e4690753
allow aborting other threads
Claus Gittinger <cg@exept.de>
parents:
3769
diff
changeset
|
628 |
|
10017 | 629 |
(cmd == $Q) ifTrue:[ |
630 |
valid := true. |
|
631 |
proc notNil ifTrue:[ |
|
632 |
proc terminateNoSignal. |
|
633 |
] ifFalse:[ |
|
634 |
id notNil ifTrue:[ |
|
635 |
'no process with id: ' print. id printCR. |
|
636 |
] ifFalse:[ |
|
637 |
Processor terminateActiveNoSignal |
|
638 |
] |
|
639 |
] |
|
640 |
]. |
|
3700 | 641 |
|
10017 | 642 |
(cmd == $g) ifTrue:[ |
643 |
valid := true. |
|
644 |
self garbageCollectCommand:id |
|
645 |
]. |
|
3700 | 646 |
|
10017 | 647 |
(cmd == $U) ifTrue:[valid := true. MessageTracer unwrapAllMethods]. |
648 |
(cmd == $X) ifTrue:[valid := true. Smalltalk fatalAbort]. |
|
649 |
(cmd == $x) ifTrue:[valid := true. OperatingSystem exit]. |
|
3700 | 650 |
|
10017 | 651 |
(cmd == $.) ifTrue:[valid := true. self printDot ]. |
652 |
(cmd == $m) ifTrue:[valid := true. self printDotsMethodSource ]. |
|
653 |
(cmd == $-) ifTrue:[valid := true. self moveDotUp ]. |
|
654 |
(cmd == $+) ifTrue:[valid := true. self moveDotDown ]. |
|
5802
93748287026d
better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents:
5054
diff
changeset
|
655 |
|
10017 | 656 |
"/ avoid usage print if return was typed ... |
657 |
((cmd == Character return) |
|
658 |
or:[cmd == Character linefeed]) ifTrue:[valid := true.]. |
|
4470 | 659 |
|
10017 | 660 |
valid ifFalse: [ |
661 |
self showValidCommandHelp. |
|
662 |
] |
|
1 | 663 |
]. |
2113
6a310e15ad58
added print-other-stacks command
Claus Gittinger <cg@exept.de>
parents:
1424
diff
changeset
|
664 |
context := nil. |
1 | 665 |
^ cmd |
1424 | 666 |
|
10017 | 667 |
"Modified: / 29-09-2006 / 12:23:18 / cg" |
1 | 668 |
! |
669 |
||
618 | 670 |
doAbort |
671 |
|con sig| |
|
672 |
||
6204
2bafef9151dd
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
5942
diff
changeset
|
673 |
(sig := AbortOperationRequest) isHandled ifTrue:[ |
8840 | 674 |
sig raise. |
675 |
'abort raise failed' errorPrintCR. |
|
618 | 676 |
]. |
677 |
||
678 |
"TEMPORARY kludge - find event handler context |
|
679 |
this will be removed, once real debugging is possible |
|
680 |
" |
|
681 |
con := self findContext:#processEvent. |
|
682 |
con isNil ifTrue:[ |
|
8840 | 683 |
con := self findContext:#dispatch. |
618 | 684 |
]. |
685 |
con notNil ifTrue:[ |
|
8840 | 686 |
"got it" |
687 |
con return. |
|
688 |
'return failed' errorPrintCR. |
|
618 | 689 |
]. |
690 |
||
1424 | 691 |
'found no context to resume' errorPrintCR. |
692 |
||
6204
2bafef9151dd
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
5942
diff
changeset
|
693 |
"Modified: / 16.11.2001 / 17:39:14 / cg" |
618 | 694 |
! |
695 |
||
5802
93748287026d
better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents:
5054
diff
changeset
|
696 |
getCommand:prompt |
3126
e37ccb66f1b0
onlz ungrab the main Display (remote display could be inoperable)
Claus Gittinger <cg@exept.de>
parents:
3009
diff
changeset
|
697 |
"/ Screen notNil ifTrue:[ |
e37ccb66f1b0
onlz ungrab the main Display (remote display could be inoperable)
Claus Gittinger <cg@exept.de>
parents:
3009
diff
changeset
|
698 |
"/ Screen allScreens do:[:aScreen | |
e37ccb66f1b0
onlz ungrab the main Display (remote display could be inoperable)
Claus Gittinger <cg@exept.de>
parents:
3009
diff
changeset
|
699 |
"/ aScreen ungrabPointer. |
e37ccb66f1b0
onlz ungrab the main Display (remote display could be inoperable)
Claus Gittinger <cg@exept.de>
parents:
3009
diff
changeset
|
700 |
"/ aScreen ungrabKeyboard. |
e37ccb66f1b0
onlz ungrab the main Display (remote display could be inoperable)
Claus Gittinger <cg@exept.de>
parents:
3009
diff
changeset
|
701 |
"/ ]. |
e37ccb66f1b0
onlz ungrab the main Display (remote display could be inoperable)
Claus Gittinger <cg@exept.de>
parents:
3009
diff
changeset
|
702 |
"/ ]. |
e37ccb66f1b0
onlz ungrab the main Display (remote display could be inoperable)
Claus Gittinger <cg@exept.de>
parents:
3009
diff
changeset
|
703 |
|
e37ccb66f1b0
onlz ungrab the main Display (remote display could be inoperable)
Claus Gittinger <cg@exept.de>
parents:
3009
diff
changeset
|
704 |
Display notNil ifTrue:[ |
10322 | 705 |
Display ungrabPointer. |
706 |
Display ungrabKeyboard. |
|
852
5c4a0585ba0b
ungrab pointer for every input
Claus Gittinger <cg@exept.de>
parents:
720
diff
changeset
|
707 |
]. |
5c4a0585ba0b
ungrab pointer for every input
Claus Gittinger <cg@exept.de>
parents:
720
diff
changeset
|
708 |
|
8840 | 709 |
(prompt |
10322 | 710 |
? (nesting == 0 ifTrue:[ |
711 |
'MiniDebugger> ' |
|
712 |
] ifFalse:[ |
|
713 |
'MiniDebugger' , nesting printString , '>' |
|
714 |
])) print. |
|
93 | 715 |
|
7706 | 716 |
UserInterrupt handle:[:ex | |
10322 | 717 |
ex restart |
159 | 718 |
] do:[ |
10322 | 719 |
|c cmd arg cnt| |
3700 | 720 |
|
10322 | 721 |
cmd := Character fromUser. |
722 |
cmd isNil ifTrue:[ |
|
723 |
" |
|
724 |
mhmh end-of-file; |
|
725 |
return a 'c' (for continue); hope thats ok. |
|
726 |
" |
|
727 |
cmd := $c |
|
728 |
]. |
|
93 | 729 |
|
10322 | 730 |
cnt := nil. |
731 |
(cmd isDigit) ifTrue:[ |
|
732 |
cnt := 0. |
|
733 |
[cmd isDigit] whileTrue:[ |
|
734 |
cnt := (cnt * 10) + cmd digitValue. |
|
735 |
cmd := Character fromUser |
|
736 |
]. |
|
737 |
[cmd == Character space] whileTrue:[ |
|
738 |
cmd := Character fromUser |
|
739 |
]. |
|
740 |
]. |
|
4003
d0f97b9cd4de
added 'S' -> stopp a process
Claus Gittinger <cg@exept.de>
parents:
3814
diff
changeset
|
741 |
|
10322 | 742 |
" |
743 |
collect to end-of-line in arg |
|
744 |
" |
|
745 |
c := cmd. |
|
746 |
arg := ''. |
|
747 |
[c isNil or:[c isEndOfLineCharacter]] whileFalse: [ |
|
748 |
arg := arg copyWith:c. |
|
749 |
c := Character fromUser. |
|
750 |
]. |
|
751 |
commandArg := arg copyFrom:2. |
|
752 |
command := cmd. |
|
753 |
commandCount := cnt. |
|
1 | 754 |
]. |
3700 | 755 |
^ command |
976 | 756 |
|
3700 | 757 |
"Modified: / 31.7.1998 / 16:11:01 / cg" |
1 | 758 |
! |
759 |
||
760 |
interpreterLoopWith:anObject |
|
10630 | 761 |
'read-eval-print loop; exit with "#exit"; help with "?"' printCR. |
11060
b6e5aa5d7887
ReadEvalPrintLoop writev help texts to Stderr
Stefan Vogel <sv@exept.de>
parents:
10634
diff
changeset
|
762 |
(ReadEvalPrintLoop new doChunkFormat:false; error:Stderr; prompt:'> ')readEvalPrintLoop. |
3700 | 763 |
|
10630 | 764 |
"/ |line done rslt| |
765 |
"/ |
|
766 |
"/ 'read-eval-print loop; exit with empty line' printCR. |
|
767 |
"/ '' printCR. |
|
768 |
"/ |
|
769 |
"/ done := false. |
|
770 |
"/ [done] whileFalse:[ |
|
771 |
"/ '> ' print. |
|
772 |
"/ |
|
773 |
"/ line := Stdin nextLine. |
|
774 |
"/ (line size == 0) ifTrue:[ |
|
775 |
"/ done := true |
|
776 |
"/ ] ifFalse:[ |
|
777 |
"/ "/ rslt := Compiler evaluate:line |
|
778 |
"/ "/ receiver:anObject |
|
779 |
"/ "/ notifying:nil. |
|
780 |
"/ |
|
781 |
"/ rslt := Compiler |
|
782 |
"/ evaluate:line |
|
783 |
"/ in:dot |
|
784 |
"/ receiver:dot receiver |
|
785 |
"/ notifying:self "/ nil |
|
786 |
"/ ifFail:[]. |
|
787 |
"/ rslt printCR. |
|
788 |
"/ ] |
|
789 |
"/ ] |
|
1424 | 790 |
|
3700 | 791 |
"Modified: / 31.7.1998 / 16:01:47 / cg" |
618 | 792 |
! |
793 |
||
2772 | 794 |
printAllBacktraces |
795 |
Process allInstancesDo:[:p | |
|
10554
d55478de663b
changed #printAllBacktraces us #isActiveProcesses
Stefan Vogel <sv@exept.de>
parents:
10374
diff
changeset
|
796 |
(p isActive not |
d55478de663b
changed #printAllBacktraces us #isActiveProcesses
Stefan Vogel <sv@exept.de>
parents:
10374
diff
changeset
|
797 |
and:[p isDead not]) ifTrue:[ |
d55478de663b
changed #printAllBacktraces us #isActiveProcesses
Stefan Vogel <sv@exept.de>
parents:
10374
diff
changeset
|
798 |
'---------------------------------------------------------' printCR. |
d55478de663b
changed #printAllBacktraces us #isActiveProcesses
Stefan Vogel <sv@exept.de>
parents:
10374
diff
changeset
|
799 |
' proc id=' print. p id print. |
d55478de663b
changed #printAllBacktraces us #isActiveProcesses
Stefan Vogel <sv@exept.de>
parents:
10374
diff
changeset
|
800 |
' name=''' print. p name print. |
d55478de663b
changed #printAllBacktraces us #isActiveProcesses
Stefan Vogel <sv@exept.de>
parents:
10374
diff
changeset
|
801 |
''' createdBy: ' print. p creatorId print. |
d55478de663b
changed #printAllBacktraces us #isActiveProcesses
Stefan Vogel <sv@exept.de>
parents:
10374
diff
changeset
|
802 |
' state=' print. p state print. |
d55478de663b
changed #printAllBacktraces us #isActiveProcesses
Stefan Vogel <sv@exept.de>
parents:
10374
diff
changeset
|
803 |
' prio=' print. p priority printCR. |
d55478de663b
changed #printAllBacktraces us #isActiveProcesses
Stefan Vogel <sv@exept.de>
parents:
10374
diff
changeset
|
804 |
'' printCR. '' printCR. |
2772 | 805 |
|
10554
d55478de663b
changed #printAllBacktraces us #isActiveProcesses
Stefan Vogel <sv@exept.de>
parents:
10374
diff
changeset
|
806 |
self printBacktraceFrom:(p suspendedContext) |
d55478de663b
changed #printAllBacktraces us #isActiveProcesses
Stefan Vogel <sv@exept.de>
parents:
10374
diff
changeset
|
807 |
] |
2772 | 808 |
] |
809 |
! |
|
810 |
||
618 | 811 |
showProcesses |
812 |
|active| |
|
813 |
||
814 |
active := Processor activeProcess. |
|
3700 | 815 |
'current id=' print. active id print. ' name=''' print. active name print. '''' printCR. |
618 | 816 |
|
3700 | 817 |
Process allSubInstancesDo:[:p | |
8840 | 818 |
'proc id=' print. (p id printStringPaddedTo:5) print. |
819 |
(p state printStringPaddedTo:10) print. |
|
820 |
' pri=' print. (p priority printStringPaddedTo:2) print. |
|
821 |
' creator:' print. (p creatorId printStringPaddedTo:5) print. |
|
822 |
' name=''' print. p name print. |
|
823 |
'''' printCR. |
|
618 | 824 |
] |
1424 | 825 |
|
3700 | 826 |
"Modified: / 31.7.1998 / 16:30:19 / cg" |
7701 | 827 |
! |
828 |
||
829 |
showValidCommandHelp |
|
17807 | 830 |
'valid commands: |
7701 | 831 |
c ..... continue |
832 |
s ..... step |
|
833 |
t ..... trace (continue with trace) |
|
834 |
a [id]. abort (i.e. raise abort signal) in (current) process |
|
835 |
T [id]. terminate (current) process |
|
836 |
W [id]. stop (current) process |
|
837 |
R [id]. resume (current) process |
|
838 |
Q [id]. quick terminate (current) process - no unwinds or cleanup |
|
839 |
||
840 |
P ..... list processes |
|
841 |
l [id]. print context chain (of process with id) |
|
842 |
b [id]. full (VM) backtrace |
|
843 |
B ..... backtrace of all other processes |
|
844 |
||
845 |
U ..... unwrap all traced/breakpointed methods |
|
846 |
g ..... collect all garbage |
|
847 |
g 2.... collect all garbage & reclaim symbols |
|
848 |
g 3.... collect all garbage, reclaim symbols and compress |
|
849 |
||
850 |
S ..... save snapshot into crash.img |
|
851 |
x ..... exit Smalltalk |
|
852 |
X ..... exit Smalltalk (+core dump) |
|
853 |
||
854 |
. ..... print dot (the current context) |
|
8717 | 855 |
m ..... print dots method source code |
856 |
- ..... move dot up (sender) |
|
857 |
+ ..... move dot down (called context) |
|
7701 | 858 |
|
859 |
r ..... receiver (in dot) printString |
|
860 |
i ..... inspect receiver (in dot) |
|
861 |
I ..... interpreter (expression evaluator) |
|
17807 | 862 |
e expr evaluate expression |
7701 | 863 |
|
864 |
To repair a broken X-Connection, enter an interpreter and evaluate: |
|
865 |
Display := XWorkstation new. |
|
866 |
Display initializeFor:''hostName:0''. |
|
867 |
Display startDispatch. |
|
868 |
NewLauncher openOnDevice:Display. |
|
869 |
<empty line> |
|
870 |
then enter ''c'' to continue; a NewLauncher should pop up soon. |
|
871 |
||
872 |
' errorPrintCR |
|
1 | 873 |
! ! |
618 | 874 |
|
658 | 875 |
!MiniDebugger class methodsFor:'documentation'! |
876 |
||
877 |
version |
|
17846 | 878 |
^ '$Id: MiniDebugger.st 10660 2011-07-18 15:22:09Z vranyj1 $' |
17807 | 879 |
! |
880 |
||
881 |
version_CVS |
|
17845 | 882 |
^ '§Header: /cvs/stx/stx/libbasic/MiniDebugger.st,v 1.78 2010/10/29 16:52:00 cg Exp §' |
17846 | 883 |
! ! |