--- a/MiniDebugger.st Fri Sep 29 13:08:15 2006 +0200
+++ b/MiniDebugger.st Fri Sep 29 13:08:23 2006 +0200
@@ -459,179 +459,179 @@
done := false.
[done] whileFalse:[
- valid := false.
- cmd := self getCommand:nil.
- cmd isNil ifTrue:[ "/ EOF -> continue
- cmd := $c
- ].
+ valid := false.
+ cmd := self getCommand:nil.
+ cmd isNil ifTrue:[ "/ EOF -> continue
+ cmd := $c
+ ].
- commandArg notEmpty ifTrue:[
- id := Number readFrom:commandArg onError:nil.
+ commandArg notEmpty ifTrue:[
+ id := Number readFrom:commandArg onError:nil.
- id notNil ifTrue:[
- proc := Process allSubInstances detect:[:p | p id == id] ifNone:nil.
- proc == Processor activeProcess ifTrue:[
- id := proc := nil
- ]
- ]
- ].
+ id notNil ifTrue:[
+ proc := Process allSubInstances detect:[:p | p id == id] ifNone:nil.
+ proc == Processor activeProcess ifTrue:[
+ id := proc := nil
+ ]
+ ]
+ ].
- (cmd == $l) ifTrue:[
- valid := true.
- proc notNil ifTrue:[
- '-------- walkback of process ' print. id print. ' -------' printCR.
- self printBacktraceFrom:(proc suspendedContext)
- ] ifFalse:[
- id notNil ifTrue:[
- 'no process with id: ' print. id printCR.
- ] ifFalse:[
- context isNil ifTrue: [
- context := self getContext
- ].
- '-------- walkback of current process -------' printCR.
- self printBacktraceFrom:context
- ]
- ].
- ].
+ (cmd == $l) ifTrue:[
+ valid := true.
+ proc notNil ifTrue:[
+ '-------- walkback of process ' print. id print. ' -------' printCR.
+ self printBacktraceFrom:(proc suspendedContext)
+ ] ifFalse:[
+ id notNil ifTrue:[
+ 'no process with id: ' print. id printCR.
+ ] ifFalse:[
+ context isNil ifTrue: [
+ context := self getContext
+ ].
+ '-------- walkback of current process -------' printCR.
+ self printBacktraceFrom:context
+ ]
+ ].
+ ].
- (cmd == $b) ifTrue:[
- valid := true.
- proc notNil ifTrue:[
- '-------- VM walkback of process ' print. id print. ' -------' printCR.
- ObjectMemory printStackBacktraceFrom:(proc suspendedContext)
- ] ifFalse:[
- id notNil ifTrue:[
- 'no process with id: ' print. id printCR.
- ] ifFalse:[
- '-------- VM walkback of current process -------' printCR.
- ObjectMemory printStackBacktrace
- ]
- ]
- ].
+ (cmd == $b) ifTrue:[
+ valid := true.
+ proc notNil ifTrue:[
+ '-------- VM walkback of process ' print. id print. ' -------' printCR.
+ ObjectMemory printStackBacktraceFrom:(proc suspendedContext)
+ ] ifFalse:[
+ id notNil ifTrue:[
+ 'no process with id: ' print. id printCR.
+ ] ifFalse:[
+ '-------- VM walkback of current process -------' printCR.
+ ObjectMemory printStackBacktrace
+ ]
+ ]
+ ].
- (cmd == $S) ifTrue:[
- valid := true.
- 'saving "crash.img"...' print.
- ObjectMemory snapShotOn:'crash.img'.
- 'done.' printCR.
- ].
+ (cmd == $S) ifTrue:[
+ valid := true.
+ 'saving "crash.img"...' print.
+ ObjectMemory writeCrashImage.
+ 'done.' printCR.
+ ].
- (cmd == $B) ifTrue:[
- valid := true.
- self printAllBacktraces
- ].
+ (cmd == $B) ifTrue:[
+ valid := true.
+ self printAllBacktraces
+ ].
- (cmd == $P) ifTrue:[
- valid := true.
- self showProcesses.
- ].
+ (cmd == $P) ifTrue:[
+ valid := true.
+ self showProcesses.
+ ].
- (cmd == $r) ifTrue:[
- valid := true.
- dot receiver printCR
- ].
+ (cmd == $r) ifTrue:[
+ valid := true.
+ dot receiver printCR
+ ].
- (cmd == $i) ifTrue:[
- valid := true.
- MiniInspector openOn:(dot receiver)
- ].
+ (cmd == $i) ifTrue:[
+ valid := true.
+ MiniInspector openOn:(dot receiver)
+ ].
- (cmd == $I) ifTrue:[
- valid := true.
- self interpreterLoopWith:nil
- ].
- context := nil.
+ (cmd == $I) ifTrue:[
+ valid := true.
+ self interpreterLoopWith:nil
+ ].
+ context := nil.
- (cmd == $c) ifTrue:[valid := true. done := true].
- (cmd == $s) ifTrue:[valid := true. done := true].
- (cmd == $t) ifTrue:[valid := true. done := true].
- (cmd == $a) ifTrue:[valid := true. done := true].
- (cmd == $u) ifTrue:[
- stepping := false.
- tracing := false.
- Processor activeProcess vmTrace:false.
- ].
+ (cmd == $c) ifTrue:[valid := true. done := true].
+ (cmd == $s) ifTrue:[valid := true. done := true].
+ (cmd == $t) ifTrue:[valid := true. done := true].
+ (cmd == $a) ifTrue:[valid := true. done := true].
+ (cmd == $u) ifTrue:[
+ stepping := false.
+ tracing := false.
+ Processor activeProcess vmTrace:false.
+ ].
- (cmd == $R) ifTrue:[
- valid := true.
- proc notNil ifTrue:[
- proc resume.
- ]
- ].
+ (cmd == $R) ifTrue:[
+ valid := true.
+ proc notNil ifTrue:[
+ proc resume.
+ ]
+ ].
- (cmd == $T) ifTrue:[
- valid := true.
- proc notNil ifTrue:[
- proc terminate.
- ] ifFalse:[
- id notNil ifTrue:[
- 'no process with id: ' print. id printCR.
- ] ifFalse:[
- Processor terminateActive
- ]
- ]
- ].
+ (cmd == $T) ifTrue:[
+ valid := true.
+ proc notNil ifTrue:[
+ proc terminate.
+ ] ifFalse:[
+ id notNil ifTrue:[
+ 'no process with id: ' print. id printCR.
+ ] ifFalse:[
+ Processor terminateActive
+ ]
+ ]
+ ].
- (cmd == $W) ifTrue:[
- valid := true.
- proc notNil ifTrue:[
- 'stopping process id: ' print. id printCR.
- proc stop.
- ] ifFalse:[
- 'invalid process id: ' print. id printCR.
- ]
- ].
+ (cmd == $W) ifTrue:[
+ valid := true.
+ proc notNil ifTrue:[
+ 'stopping process id: ' print. id printCR.
+ proc stop.
+ ] ifFalse:[
+ 'invalid process id: ' print. id printCR.
+ ]
+ ].
- (cmd == $a) ifTrue:[
- "without id-arg, this is handled by caller"
- proc notNil ifTrue:[
- 'aborting process id: ' print. id printCR.
- valid := true.
- proc interruptWith:[AbortOperationRequest raise]
- ] ifFalse:[
- 'aborting' printCR.
- ]
- ].
+ (cmd == $a) ifTrue:[
+ "without id-arg, this is handled by caller"
+ proc notNil ifTrue:[
+ 'aborting process id: ' print. id printCR.
+ valid := true.
+ proc interruptWith:[AbortOperationRequest raise]
+ ] ifFalse:[
+ 'aborting' printCR.
+ ]
+ ].
- (cmd == $Q) ifTrue:[
- valid := true.
- proc notNil ifTrue:[
- proc terminateNoSignal.
- ] ifFalse:[
- id notNil ifTrue:[
- 'no process with id: ' print. id printCR.
- ] ifFalse:[
- Processor terminateActiveNoSignal
- ]
- ]
- ].
+ (cmd == $Q) ifTrue:[
+ valid := true.
+ proc notNil ifTrue:[
+ proc terminateNoSignal.
+ ] ifFalse:[
+ id notNil ifTrue:[
+ 'no process with id: ' print. id printCR.
+ ] ifFalse:[
+ Processor terminateActiveNoSignal
+ ]
+ ]
+ ].
- (cmd == $g) ifTrue:[
- valid := true.
- self garbageCollectCommand:id
- ].
+ (cmd == $g) ifTrue:[
+ valid := true.
+ self garbageCollectCommand:id
+ ].
- (cmd == $U) ifTrue:[valid := true. MessageTracer unwrapAllMethods].
- (cmd == $X) ifTrue:[valid := true. Smalltalk fatalAbort].
- (cmd == $x) ifTrue:[valid := true. OperatingSystem exit].
+ (cmd == $U) ifTrue:[valid := true. MessageTracer unwrapAllMethods].
+ (cmd == $X) ifTrue:[valid := true. Smalltalk fatalAbort].
+ (cmd == $x) ifTrue:[valid := true. OperatingSystem exit].
- (cmd == $.) ifTrue:[valid := true. self printDot ].
- (cmd == $m) ifTrue:[valid := true. self printDotsMethodSource ].
- (cmd == $-) ifTrue:[valid := true. self moveDotUp ].
- (cmd == $+) ifTrue:[valid := true. self moveDotDown ].
+ (cmd == $.) ifTrue:[valid := true. self printDot ].
+ (cmd == $m) ifTrue:[valid := true. self printDotsMethodSource ].
+ (cmd == $-) ifTrue:[valid := true. self moveDotUp ].
+ (cmd == $+) ifTrue:[valid := true. self moveDotDown ].
- "/ avoid usage print if return was typed ...
- ((cmd == Character return)
- or:[cmd == Character linefeed]) ifTrue:[valid := true.].
+ "/ avoid usage print if return was typed ...
+ ((cmd == Character return)
+ or:[cmd == Character linefeed]) ifTrue:[valid := true.].
- valid ifFalse: [
- self showValidCommandHelp.
- ]
+ valid ifFalse: [
+ self showValidCommandHelp.
+ ]
].
context := nil.
^ cmd
- "Modified: / 31.7.1998 / 17:10:23 / cg"
+ "Modified: / 29-09-2006 / 12:23:18 / cg"
!
doAbort
@@ -838,5 +838,5 @@
!MiniDebugger class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/MiniDebugger.st,v 1.67 2005-04-13 15:48:22 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/MiniDebugger.st,v 1.68 2006-09-29 11:08:23 cg Exp $'
! !