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