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