--- a/CBrowser.st Thu Jan 13 01:16:57 1994 +0100
+++ b/CBrowser.st Sun Jan 16 05:00:29 1994 +0100
@@ -28,7 +28,7 @@
this class implements a changes browser.
-$Header: /cvs/stx/stx/libtool/Attic/CBrowser.st,v 1.6 1994-01-08 17:22:50 claus Exp $
+$Header: /cvs/stx/stx/libtool/Attic/CBrowser.st,v 1.7 1994-01-16 03:59:52 claus Exp $
written jan 90 by claus
'!
@@ -443,13 +443,16 @@
codeView abortAction:nil.
aStream close.
^self].
+
changeNrProcessed := changeNr.
[
- sawExcla ifFalse:[
- Compiler evaluate:chunk notifying:self
- ] ifTrue:[
- (Compiler evaluate:chunk notifying:self) fileInFrom:aStream
- notifying:self
+ Object abortSignal catch:[
+ sawExcla ifFalse:[
+ Compiler evaluate:chunk notifying:self
+ ] ifTrue:[
+ (Compiler evaluate:chunk notifying:self) fileInFrom:aStream
+ notifying:self
+ ]
].
changeNrProcessed := nil.
codeView abortAction:nil
--- a/ChangesBrowser.st Thu Jan 13 01:16:57 1994 +0100
+++ b/ChangesBrowser.st Sun Jan 16 05:00:29 1994 +0100
@@ -28,7 +28,7 @@
this class implements a changes browser.
-$Header: /cvs/stx/stx/libtool/ChangesBrowser.st,v 1.6 1994-01-08 17:22:50 claus Exp $
+$Header: /cvs/stx/stx/libtool/ChangesBrowser.st,v 1.7 1994-01-16 03:59:52 claus Exp $
written jan 90 by claus
'!
@@ -443,13 +443,16 @@
codeView abortAction:nil.
aStream close.
^self].
+
changeNrProcessed := changeNr.
[
- sawExcla ifFalse:[
- Compiler evaluate:chunk notifying:self
- ] ifTrue:[
- (Compiler evaluate:chunk notifying:self) fileInFrom:aStream
- notifying:self
+ Object abortSignal catch:[
+ sawExcla ifFalse:[
+ Compiler evaluate:chunk notifying:self
+ ] ifTrue:[
+ (Compiler evaluate:chunk notifying:self) fileInFrom:aStream
+ notifying:self
+ ]
].
changeNrProcessed := nil.
codeView abortAction:nil
--- a/DebugView.st Thu Jan 13 01:16:57 1994 +0100
+++ b/DebugView.st Sun Jan 16 05:00:29 1994 +0100
@@ -37,7 +37,7 @@
or in one of the eventhandler processes - in this case, the debugger
will sit on an exclusive display connection.
-$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.9 1994-01-13 00:14:55 claus Exp $
+$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.10 1994-01-16 04:00:29 claus Exp $
written spring/summer 89 by claus
'!
@@ -56,9 +56,11 @@
ProcessorScheduler isPureEventDriven ifTrue:[
CachedDebugger isNil ifTrue:[
- CachedDebugger := self newExclusive
+ ^ self newExclusive
].
- ^ CachedDebugger
+ debugger := CachedDebugger.
+ CachedDebugger := nil.
+ ^ debugger
].
((Processor activeProcess priority > Processor userSchedulingPriority)
or:[Processor activeProcess nameOrId endsWith:'dispatcher']) ifTrue:[
@@ -66,15 +68,13 @@
^ self newExclusive
].
- (CachedDebugger isNil or:[CachedDebugger busy]) ifTrue:[
+ CachedDebugger isNil ifTrue:[
debugger := super new.
debugger label:'Debugger'.
debugger icon:(Form fromFile:'Debugger.xbm' resolution:100).
] ifFalse:[
- debugger := CachedDebugger
- ].
- CachedDebugger isNil ifTrue:[
- CachedDebugger := debugger
+ debugger := CachedDebugger.
+ CachedDebugger := nil
].
^ debugger
!
@@ -134,6 +134,19 @@
"Debugger enter"
!
+enter:aContext
+ "enter the debugger on aContext"
+
+ |aDebugger name|
+
+ StepInterruptPending := nil.
+ aDebugger := self new.
+ name := Processor activeProcess nameOrId.
+ aDebugger label:'Debugger (process: ' , name , ')'.
+ aDebugger enter:aContext.
+ ^ nil
+!
+
openOn:aProcess
"enter the debugger on aProcess"
@@ -231,13 +244,15 @@
initializeMiddleButtonMenu
|labels|
- labels := resources array:#('continue'
+ labels := resources array:#(
+"
+ 'continue'
'terminate'
'abort'
'-'
'step'
- 'trace step'
'send'
+ '-'
"
'trace'
'untrace'
@@ -245,24 +260,25 @@
'-'
'resume'
'restart'
+"
'-'
-"
'breakpoints'
'-'
-"
'exit smalltalk'
).
contextView
middleButtonMenu:(PopUpMenu
labels:labels
- selectors:#(doContinue
+ selectors:#(
+"
+ doContinue
doTerminate
doAbort
nil
doStep
- doTraceStep
doSend
+ nil
"
doTrace
doNoTrace
@@ -270,12 +286,12 @@
nil
doResume
doRestart
+"
nil
-"
doBreakpoints
nil
-"
- doExit)
+ doExit
+ )
receiver:self
for:contextView)
@@ -385,10 +401,28 @@
!
enter
+ "enter the debugger - on the sending context"
+
+ |where|
+
+ busy := true.
+
+ where := thisContext.
+ where := where sender.
+ where notNil ifTrue:[
+ (where receiver == DebugView) ifTrue:[
+ where := where sender
+ ]
+ "where is now interrupted methods context"
+ ].
+ ^ self enter:where
+!
+
+enter:aContext
"enter the debugger - get and display the context, then start an
exclusive event loop on top of eveything else"
- |where con selection|
+ |con selection index|
busy := true.
bigStep := false.
@@ -423,27 +457,21 @@
self raise.
Display synchronizeOutput.
- where := thisContext.
- where := where sender.
- where notNil ifTrue:[
- (where receiver == DebugView) ifTrue:[
- where := where sender
- ]
- "where is now interrupted methods context"
- ].
- self setContext:where.
+ self setContext:aContext.
- "select context, where halt was ..."
- ( #(halt error raise) includes:where sender selector) ifTrue:[
- selection := 3
+ "preselect a more interresting context, (where halt was ...)"
+ ( #(halt error raise halt: error:) includes:aContext sender sender selector) ifTrue:[
+ selection := 4
] ifFalse:[
- ( #(halt: error:) includes:where selector) ifTrue:[
- selection := 2
+ ( #(halt error raise halt: error:) includes:aContext sender selector) ifTrue:[
+ selection := 3
+ ] ifFalse:[
+ ( #(halt: error:) includes:aContext selector) ifTrue:[
+ selection := 2
+ ]
]
].
- where := nil.
-
"if we came here by a big-step, show the method where we are"
steppedContextAddress notNil ifTrue:[
selection := 3
@@ -454,13 +482,14 @@
contextView selection:selection
].
- canAbort := false.
- 1 to:contextArray size do:[:index |
- (#(doIt printIt inspectIt)
- includes:(contextArray at:index) selector) ifTrue:[
- canAbort := true
- ]
+ "look for doIt, printIt, inspectIt or AbortSignal handle:do: context"
+ canAbort := contextArray inject:false into:[:found :con |
+ found
+ or:[(#(doIt printIt inspectIt) includes:con selector)
+ or:[((con receiver == Object abortSignal) or:[con receiver == SignalSet anySignal])
+ and:[con selector == #handle:do:]]]
].
+
canAbort ifTrue:[
abortButton enable.
contextView middleButtonMenu enable:#doAbort.
@@ -479,16 +508,17 @@
canContinue := true.
self controlLoop.
- "kludge: look for a doIt, printIt or inspectIt frame for abort"
+ "look for doIt, printIt, inspectIt or AbortSignal handle:do: context"
(canAbort and:[exitAction == #abort]) ifTrue:[
- selectedContext := nil.
- 1 to:contextArray size do:[:index |
- (#(doIt printIt inspectIt)
- includes:(contextArray at:index) selector) ifTrue:[
- selectedContext := contextArray at:index
- ]
- ].
- exitAction := #resume
+ index := contextArray findFirst:[:con |
+ (#(doIt printIt inspectIt) includes:con selector)
+ or:[((con receiver == Object abortSignal) or:[con receiver == SignalSet anySignal])
+ and:[con selector == #handle:do:]]].
+
+ selectedContext := contextArray at:index ifAbsent:[nil].
+ selectedContext notNil ifTrue:[
+ exitAction := #resume.
+ ]
].
contextArray := nil.
@@ -502,6 +532,7 @@
selectedContext := nil.
InInterrupt := nil.
busy := false.
+ CachedDebugger := self.
con unwind.
'cannot resume selected context' printNewline
]
@@ -512,6 +543,7 @@
selectedContext := nil.
InInterrupt := nil.
busy := false.
+ CachedDebugger := self.
con restart.
'cannot restart selected context' printNewline
]
@@ -520,6 +552,7 @@
selectedContext := nil.
InInterrupt := nil.
busy := false.
+ CachedDebugger := self.
Processor activeProcess terminate.
'cannot terminate process' printNewline
]
@@ -545,7 +578,8 @@
InterruptPending := true.
InStepInterrupt := nil
] ifFalse:[
- busy := false
+ busy := false.
+ CachedDebugger := self.
]
!
@@ -554,9 +588,7 @@
in this case, we are just inspecting the context chain of the process,
not offering continue/abort/step and send functions.
Also, we do not run on top of the debugger process, but as a separate
- one."
-
- | con selection|
+ one. (think of it as an inspector showing more detail)"
busy := true.
bigStep := false.
@@ -807,7 +839,9 @@
!
doBreakpoints
- ^ self
+ "set/clear breakpoints - not implemented yet"
+
+ self warn:'this function is not yet implemented'.
!
doSend
@@ -829,12 +863,11 @@
canContinue ifTrue:[
selectedContext notNil ifTrue:[
- bigStep := true.
steppedContextAddress := ObjectMemory addressOf:selectedContext
] ifFalse:[
- bigStep := true.
steppedContextAddress := ObjectMemory addressOf:(contextArray at:2)
].
+ bigStep := true.
haveControl := false.
exitAction := #step.
ProcessorScheduler isPureEventDriven ifFalse:[
@@ -845,7 +878,7 @@
!
doTraceStep
- "tracestep from menu"
+ "tracestep - not implemented yet"
canContinue ifTrue:[
tracing := true.
@@ -914,8 +947,13 @@
!
doTrace
+ "tracing - not really implemented ..."
+
|v b|
+ self warn:'this function is not yet implemented'.
+
+false ifTrue:[
traceView isNil ifTrue:[
v := StandardSystemView on:Display.
v label:'Debugger-Trace'.
@@ -934,16 +972,16 @@
extent:[v width @ (v height - b height)]
].
v realize.
+].
tracing := true.
- self doStep
!
doNoTrace
traceView notNil ifTrue:[
traceView topView destroy.
traceView := nil.
- tracing := false
- ]
+ ].
+ tracing := false
!
doContinue