--- a/DebugView.st Mon Mar 06 20:30:54 1995 +0100
+++ b/DebugView.st Mon Mar 06 20:32:18 1995 +0100
@@ -14,12 +14,12 @@
StandardSystemView subclass:#DebugView
instanceVariableNames:'busy haveControl exitAction canContinue contextView codeView
- receiverInspector contextInspector contextArray selectedContext
- catchBlock grabber traceView tracing bigStep skipLineNr
- steppedContextAddress canAbort abortButton terminateButton
- continueButton stepButton sendButton returnButton restartButton
- exclusive inspecting nChainShown inspectedProcess updateProcess
- monitorToggle stepping steppedContextLineno actualContext inWrap'
+ receiverInspector contextInspector contextArray selectedContext
+ catchBlock grabber traceView tracing bigStep skipLineNr
+ steppedContextAddress canAbort abortButton terminateButton
+ continueButton stepButton sendButton returnButton restartButton
+ exclusive inspecting nChainShown inspectedProcess updateProcess
+ monitorToggle stepping steppedContextLineno actualContext inWrap'
classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail'
poolDictionaries:''
category:'Interface-Debugger'
@@ -29,7 +29,7 @@
COPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.27 1995-02-28 21:55:50 claus Exp $
+$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.28 1995-03-06 19:31:13 claus Exp $
'!
!DebugView class methodsFor:'documentation'!
@@ -50,7 +50,7 @@
version
"
-$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.27 1995-02-28 21:55:50 claus Exp $
+$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.28 1995-03-06 19:31:13 claus Exp $
"
!
@@ -407,8 +407,9 @@
'remove breakpoint'
'remove all trace & breakpoints'
'-'
- 'implementors ...'
- 'senders ...'
+ 'browse class'
+ 'implementors'
+ 'senders'
'-'
'inspect context'
'-'
@@ -632,7 +633,7 @@
setContext:aContext
"show calling chain from aContext in the walk-back listview"
- |con text method caller caller2 m|
+ |con text method caller caller2 m count|
(contextArray notNil and:[aContext == (contextArray at:1)]) ifTrue:[
"no change"
@@ -655,8 +656,9 @@
"
get them all
"
- [con notNil and:[contextArray size <= nChainShown]] whileTrue:[
- contextArray add:con.
+ count := 0.
+ [con notNil and:[count <= nChainShown]] whileTrue:[
+ contextArray add:con. count := count + 1.
(MoreDebuggingDetail == true) ifTrue:[
text add:(((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString).
] ifFalse:[
@@ -793,28 +795,28 @@
us here
"
(grabber := device activePointerGrab) notNil ifTrue:[
- device ungrabPointer
+ device ungrabPointer
].
terminateButton enable.
drawableId notNil ifTrue:[
- "not the first time - realize at old position"
- terminateButton turnOffWithoutRedraw.
- continueButton turnOffWithoutRedraw.
- returnButton turnOffWithoutRedraw.
- restartButton turnOffWithoutRedraw.
- abortButton turnOffWithoutRedraw.
- stepButton turnOffWithoutRedraw.
- sendButton turnOffWithoutRedraw.
+ "not the first time - realize at old position"
+ terminateButton turnOffWithoutRedraw.
+ continueButton turnOffWithoutRedraw.
+ returnButton turnOffWithoutRedraw.
+ restartButton turnOffWithoutRedraw.
+ abortButton turnOffWithoutRedraw.
+ stepButton turnOffWithoutRedraw.
+ sendButton turnOffWithoutRedraw.
] ifFalse:[
- exclusive ifFalse:[
- windowGroup isNil ifTrue:[
- windowGroup := WindowGroup new.
- windowGroup addTopView:self.
- ].
- ].
- self iconLabel:'Debugger'.
+ exclusive ifFalse:[
+ windowGroup isNil ifTrue:[
+ windowGroup := WindowGroup new.
+ windowGroup addTopView:self.
+ ].
+ ].
+ self iconLabel:'Debugger'.
].
"
@@ -831,76 +833,76 @@
in the context where the raise actually occured.
"
exitAction == #step ifTrue:[
- selection := 1.
- steppedContextAddress notNil ifTrue:[
- "
- if we came here by a big-step, show the method where we are
- "
- (ObjectMemory addressOf:aContext) == steppedContextAddress ifTrue:[
- selection := 1
- ] ifFalse:[
- (ObjectMemory addressOf:aContext sender) == steppedContextAddress ifTrue:[
- selection := 2
- ]
- ].
- "
- for bigStep, we could also be in a block below the actual method ...
- "
- (aContext home notNil and:[
- (ObjectMemory addressOf:aContext home) == steppedContextAddress]) ifTrue:[
- selection := 1
- ] ifFalse:[
- (aContext sender home notNil and:[
- (ObjectMemory addressOf:aContext sender home) == steppedContextAddress]) ifTrue:[
- selection := 2
- ]
- ].
- ]
+ selection := 1.
+ steppedContextAddress notNil ifTrue:[
+ "
+ if we came here by a big-step, show the method where we are
+ "
+ (ObjectMemory addressOf:aContext) == steppedContextAddress ifTrue:[
+ selection := 1
+ ] ifFalse:[
+ (ObjectMemory addressOf:aContext sender) == steppedContextAddress ifTrue:[
+ selection := 2
+ ]
+ ].
+ "
+ for bigStep, we could also be in a block below the actual method ...
+ "
+ (aContext home notNil and:[
+ (ObjectMemory addressOf:aContext home) == steppedContextAddress]) ifTrue:[
+ selection := 1
+ ] ifFalse:[
+ (aContext sender home notNil and:[
+ (ObjectMemory addressOf:aContext sender home) == steppedContextAddress]) ifTrue:[
+ selection := 2
+ ]
+ ].
+ ]
] ifFalse:[
- steppedContextAddress isNil ifTrue:[
- "
- preselect a more interresting context, (where halt/raise was ...)
- "
- selection := self interrestingContextFrom:aContext.
- ] ifFalse:[
- "
- if we came here by a big-step, show the method where we are
- "
- (ObjectMemory addressOf:aContext) == steppedContextAddress ifTrue:[
- selection := 1
- ] ifFalse:[
- (ObjectMemory addressOf:aContext sender) == steppedContextAddress ifTrue:[
- selection := 2
- ]
- ]
- ]
+ steppedContextAddress isNil ifTrue:[
+ "
+ preselect a more interresting context, (where halt/raise was ...)
+ "
+ selection := self interrestingContextFrom:aContext.
+ ] ifFalse:[
+ "
+ if we came here by a big-step, show the method where we are
+ "
+ (ObjectMemory addressOf:aContext) == steppedContextAddress ifTrue:[
+ selection := 1
+ ] ifFalse:[
+ (ObjectMemory addressOf:aContext sender) == steppedContextAddress ifTrue:[
+ selection := 2
+ ]
+ ]
+ ]
].
selection notNil ifTrue:[
- self showSelection:selection.
- contextView selection:selection.
- selection > 1 ifTrue:[
- contextView scrollToLine:(selection - 1)
- ]
+ self showSelection:selection.
+ contextView selection:selection.
+ selection > 1 ifTrue:[
+ contextView scrollToLine:(selection - 1)
+ ]
].
m := contextView middleButtonMenu.
m notNil ifTrue:[
- canAbort := inspecting or:[Object abortSignal isHandled].
- canAbort ifTrue:[
- abortButton enable.
- m enable:#doAbort.
- ] ifFalse:[
- abortButton disable.
- m disable:#doAbort.
- ].
- exclusive ifTrue:[
- terminateButton disable.
- m disable:#doTerminate.
- ] ifFalse:[
- terminateButton enable.
- m enable:#doTerminate.
- ]
+ canAbort := inspecting or:[Object abortSignal isHandled].
+ canAbort ifTrue:[
+ abortButton enable.
+ m enable:#doAbort.
+ ] ifFalse:[
+ abortButton disable.
+ m disable:#doAbort.
+ ].
+ exclusive ifTrue:[
+ terminateButton disable.
+ m disable:#doTerminate.
+ ] ifFalse:[
+ terminateButton enable.
+ m enable:#doTerminate.
+ ]
].
"
@@ -910,9 +912,9 @@
position again
"
drawableId notNil ifTrue:[
- self rerealize
+ self rerealize
] ifFalse:[
- self realize.
+ self realize.
].
"
@@ -944,30 +946,30 @@
contextInspector release.
(exitAction ~~ #step) ifTrue:[
- self unrealize.
- device synchronizeOutput.
+ self unrealize.
+ device synchronizeOutput.
- (exitAction == #abort) ifTrue:[
- self cacheMyself.
- "
- have to catch errors occuring in unwind-blocks
- "
- Object errorSignal handle:[:ex |
- 'ignored error while unwinding: ' errorPrint.
- ex errorString errorPrintNL.
- ex proceed
- ] do:[
- Object abortSignal raise.
- ].
- 'abort failed' errorPrintNL
- ].
+ (exitAction == #abort) ifTrue:[
+ self cacheMyself.
+ "
+ have to catch errors occuring in unwind-blocks
+ "
+ Object errorSignal handle:[:ex |
+ 'ignored error while unwinding: ' errorPrint.
+ ex errorString errorPrintNL.
+ ex proceed
+ ] do:[
+ Object abortSignal raise.
+ ].
+ 'abort failed' errorPrintNL
+ ].
- (exitAction == #return) ifTrue:[
- selectedContext notNil ifTrue:[
- "
- if there is a selection in the codeView,
- evaluate it and use the result as return value
- "
+ (exitAction == #return) ifTrue:[
+ selectedContext notNil ifTrue:[
+ "
+ if there is a selection in the codeView,
+ evaluate it and use the result as return value
+ "
"/ disabled for now, there is almost always a selection (the current line)
"/ and that is syntactically incorrect ...
"/ ... leading to a popup warning from the codeView
@@ -983,106 +985,106 @@
"/ ].
"/ ].
- con := selectedContext.
- self cacheMyself.
- "
- have to catch errors occuring in unwind-blocks
- "
- Object errorSignal handle:[:ex |
- 'ignored error while unwinding: ' errorPrint.
- ex errorString errorPrintNL.
- ex proceed
- ] do:[
- con unwind:retval.
- ].
- 'cannot return from selected context' errorPrintNL
- ]
- ].
+ con := selectedContext.
+ self cacheMyself.
+ "
+ have to catch errors occuring in unwind-blocks
+ "
+ Object errorSignal handle:[:ex |
+ 'ignored error while unwinding: ' errorPrint.
+ ex errorString errorPrintNL.
+ ex proceed
+ ] do:[
+ con unwind:retval.
+ ].
+ 'cannot return from selected context' errorPrintNL
+ ]
+ ].
- (exitAction == #restart) ifTrue:[
- selectedContext notNil ifTrue:[
- con := selectedContext.
- self cacheMyself.
- "
- have to catch errors occuring in unwind-blocks
- "
- Object errorSignal handle:[:ex |
- 'ignored error while unwinding: ' errorPrint.
- ex errorString errorPrintNL.
- ex proceed
- ] do:[
- con unwindAndRestart.
- ].
- 'cannot restart selected context' errorPrintNL
- ]
- ].
+ (exitAction == #restart) ifTrue:[
+ selectedContext notNil ifTrue:[
+ con := selectedContext.
+ self cacheMyself.
+ "
+ have to catch errors occuring in unwind-blocks
+ "
+ Object errorSignal handle:[:ex |
+ 'ignored error while unwinding: ' errorPrint.
+ ex errorString errorPrintNL.
+ ex proceed
+ ] do:[
+ con unwindAndRestart.
+ ].
+ 'cannot restart selected context' errorPrintNL
+ ]
+ ].
- (exitAction == #quickTerminate) ifTrue:[
- self cacheMyself.
- Processor activeProcess terminateNoSignal
- ].
+ (exitAction == #quickTerminate) ifTrue:[
+ self cacheMyself.
+ Processor activeProcess terminateNoSignal
+ ].
- (exitAction == #terminate) ifTrue:[
- self cacheMyself.
- "
- have to catch errors occuring in unwind-blocks
- "
- Object errorSignal handle:[:ex |
- 'ignored error while unwinding: ' errorPrint.
- ex errorString errorPrintNL.
- ex proceed
- ] do:[
- Processor activeProcess terminate.
- ].
- 'cannot terminate process' errorPrintNL
- ]
+ (exitAction == #terminate) ifTrue:[
+ self cacheMyself.
+ "
+ have to catch errors occuring in unwind-blocks
+ "
+ Object errorSignal handle:[:ex |
+ 'ignored error while unwinding: ' errorPrint.
+ ex errorString errorPrintNL.
+ ex proceed
+ ] do:[
+ Processor activeProcess terminate.
+ ].
+ 'cannot terminate process' errorPrintNL
+ ]
].
selectedContext := actualContext := nil.
grabber notNil ifTrue:[
- device grabPointerInView:grabber.
- grabber := nil.
+ device grabPointerInView:grabber.
+ grabber := nil.
].
(exitAction == #step) ifTrue:[
- "
- schedule another stepInterrupt
- - must enter myself into the collection of open debuggers,
- in case the stepping process comes back again via a halt or signal
- before the step is finished. In this case, the stepping debugger should
- come up (instead of a new one)
- - must flush caches since optimized methods not always
- look for pending interrupts
- "
- OpenDebuggers isNil ifTrue:[
- OpenDebuggers := WeakArray with:self
- ] ifFalse:[
- (OpenDebuggers includes:self) ifFalse:[
- idx := OpenDebuggers identityIndexOf:nil.
- idx ~~ 0 ifTrue:[
- OpenDebuggers at:idx put:self
- ] ifFalse:[
- OpenDebuggers := OpenDebuggers copyWith:self
- ]
- ]
- ].
- self label:'single stepping - please wait ...'.
- stepping := true.
+ "
+ schedule another stepInterrupt
+ - must enter myself into the collection of open debuggers,
+ in case the stepping process comes back again via a halt or signal
+ before the step is finished. In this case, the stepping debugger should
+ come up (instead of a new one)
+ - must flush caches since optimized methods not always
+ look for pending interrupts
+ "
+ OpenDebuggers isNil ifTrue:[
+ OpenDebuggers := WeakArray with:self
+ ] ifFalse:[
+ (OpenDebuggers includes:self) ifFalse:[
+ idx := OpenDebuggers identityIndexOf:nil.
+ idx ~~ 0 ifTrue:[
+ OpenDebuggers at:idx put:self
+ ] ifFalse:[
+ OpenDebuggers := OpenDebuggers copyWith:self
+ ]
+ ]
+ ].
+ self label:'single stepping - please wait ...'.
+ stepping := true.
- ObjectMemory stepInterruptHandler:self.
- ObjectMemory flushInlineCaches.
- StepInterruptPending := 1.
- InterruptPending := 1.
- InStepInterrupt := nil
+ ObjectMemory stepInterruptHandler:self.
+ ObjectMemory flushInlineCaches.
+ StepInterruptPending := 1.
+ InterruptPending := 1.
+ InStepInterrupt := nil
] ifFalse:[
- OpenDebuggers notNil ifTrue:[
- idx := OpenDebuggers identityIndexOf:self.
- idx ~~ 0 ifTrue:[
- OpenDebuggers at:idx put:nil
- ]
- ].
- self cacheMyself.
+ OpenDebuggers notNil ifTrue:[
+ idx := OpenDebuggers identityIndexOf:self.
+ idx ~~ 0 ifTrue:[
+ OpenDebuggers at:idx put:nil
+ ]
+ ].
+ self cacheMyself.
]
!
@@ -1840,21 +1842,21 @@
"return - the selected context will do a ^nil"
inspecting ifTrue:[
- selectedContext isNil ifTrue:[
- ^ self showError:'** select a context first **'
- ].
- self interruptProcessWith:[selectedContext unwind].
- ^ self
+ selectedContext isNil ifTrue:[
+ ^ self showError:'** select a context first **'
+ ].
+ self interruptProcessWith:[selectedContext unwind].
+ ^ self
].
steppedContextAddress := nil.
haveControl := false.
exitAction := #return.
ProcessorScheduler isPureEventDriven ifFalse:[
- "exit private event-loop"
- catchBlock notNil ifTrue:[catchBlock value].
- 'DEBUGGER: oops, return failed' errorPrintNL.
- returnButton turnOff.
+ "exit private event-loop"
+ catchBlock notNil ifTrue:[catchBlock value].
+ 'DEBUGGER: oops, return failed' errorPrintNL.
+ returnButton turnOff.
].
!
@@ -2042,4 +2044,3 @@
]
! !
-