--- a/MiniDebugger.st Thu Jan 09 16:15:56 1997 +0100
+++ b/MiniDebugger.st Thu Jan 09 18:56:35 1997 +0100
@@ -250,6 +250,14 @@
traceBlock := aBlockOrNil.
stepping := false.
tracing := true
+!
+
+printBacktraceFrom:aContext
+ aContext notNil ifTrue:[
+ aContext fullPrintAll
+ ] ifFalse:[
+ 'no context' errorPrintCR
+ ]
! !
!MiniDebugger methodsFor:'user commands'!
@@ -266,16 +274,16 @@
context isNil ifTrue: [
context := self getContext
].
- context notNil ifTrue:[
- context fullPrintAll
- ] ifFalse:[
- 'no context' errorPrintCR
- ]
+ self printBacktraceFrom:context
].
(cmd == $b) ifTrue:[
valid := true.
Smalltalk printStackBacktrace
].
+ (cmd == $B) ifTrue:[
+ valid := true.
+ self printAllBacktraces
+ ].
(cmd == $P) ifTrue:[
valid := true.
self showProcesses.
@@ -346,6 +354,7 @@
(t)race (continue with trace)
(p)rint context chain
(b)full backtrace
+ (B)backtrace of all other processes
(r)eceiver printString
(R)eceiver storeString
(i)nspect (enter inspector on receiver)
@@ -359,6 +368,7 @@
(x)exit Smalltalk' errorPrintCR
]
].
+ context := nil.
^ cmd
"Modified: 20.5.1996 / 10:22:50 / cg"
@@ -450,15 +460,34 @@
'current id=' print. active id print. ' name=' print. active name printCR.
Process allInstancesDo:[:p |
- 'proc id=' print. p id print. ' name=' print. p name print. ' state=' print.
- p state print. ' prio=' print. p priority printCR.
+ 'proc id=' print. p id print.
+ ' name=' print. p name print.
+ ' state=' print.
+ p state print.
+ ' prio=' print. p priority printCR.
]
"Modified: 20.5.1996 / 10:28:25 / cg"
+!
+
+printAllBacktraces
+ Process allInstancesDo:[:p |
+ (p ~~ Processor actriveProcess
+ and:[p isDead not]) ifTrue:[
+ '---------------------------------------------------------' printCR.
+ ' proc id=' print. p id print.
+ ' name=' print. p name print. '
+ state=' print. p state print.
+ ' prio=' print. p priority printCR.
+ '' printCR. '' printCR.
+
+ self printBacktraceFrom:(p suspendedContext)
+ ]
+ ]
! !
!MiniDebugger class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/MiniDebugger.st,v 1.27 1996-05-20 08:37:19 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/MiniDebugger.st,v 1.28 1997-01-09 17:56:35 cg Exp $'
! !