DebugView.st
changeset 2317 c2000833c86d
parent 2313 265e13afc504
child 2321 7877f1254173
--- a/DebugView.st	Wed Aug 04 16:38:29 1999 +0200
+++ b/DebugView.st	Wed Aug 04 17:07:36 1999 +0200
@@ -13,14 +13,15 @@
 StandardSystemView subclass:#DebugView
 	instanceVariableNames:'busy haveControl exitAction canContinue contextView codeView
 		receiverInspector contextInspector contextArray selectedContext
-		catchBlock grabber traceView tracing bigStep skipLineNr
-		steppedContextAddress abortButton terminateButton continueButton
-		stepButton nextButton nextOverButton nextOutButton sendButton
-		returnButton restartButton exclusive inspecting nChainShown
-		inspectedProcess updateProcess stopButton updateButton
-		monitorToggle stepping steppedContextLineno stepForReturn
-		actualContext inWrap stackInspector steppedContext wrapperContext
-		verboseBacktrace firstContext stepHow cachable currentMethod'
+		catchBlock grabber mayProceed traceView tracing bigStep
+		skipLineNr steppedContextAddress abortButton terminateButton
+		continueButton stepButton nextButton nextOverButton nextOutButton
+		sendButton returnButton restartButton exclusive inspecting
+		nChainShown inspectedProcess updateProcess stopButton
+		updateButton monitorToggle stepping steppedContextLineno
+		stepForReturn actualContext inWrap stackInspector steppedContext
+		wrapperContext verboseBacktrace firstContext stepHow cachable
+		currentMethod'
 	classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail
 		DebuggingDebugger VerboseBacktraceDefault DefaultIcon
 		InitialNCHAINShown'
@@ -96,21 +97,7 @@
 
 !DebugView class methodsFor:'instance creation'!
 
-enter
-    "another way of entering the debugger"
-
-    ^ self enter:(thisContext sender) withMessage:'Debugger'
-
-    "Debugger enter"
-!
-
-enter:aContext
-    "enter the debugger on aContext"
-
-    ^ self enter:aContext withMessage:'Debugger'
-!
-
-enter:aContext withMessage:aString
+enter:aContext withMessage:aString mayProceed:mayProceed
     "enter a debugger; if this is a recursive invocation, enter
      a MiniDebugger instead.
      This is the standard way of entering the debugger;
@@ -128,7 +115,7 @@
         c := thisContext sender.
         [found not
          and:[c notNil 
-         and:[c selector ~~ #enter:withMessage:]]] whileTrue:[
+         and:[c selector ~~ #enter:withMessage:mayProceed:]]] whileTrue:[
             c selector == #noByteCode ifTrue:[
                 found := true
             ].
@@ -138,7 +125,8 @@
         found ifFalse:[
             ('DebugView [warning]: reentered with: ', aString) errorPrintCR.
             ^ MiniDebugger 
-                enterWithMessage:'DebugView [error]: recursive error (in debugger)'.
+                enterWithMessage:'DebugView [error]: recursive error (in debugger)'
+                mayProceed:mayProceed.
         ]
     ].
 
@@ -156,18 +144,19 @@
 "/ 'entering stepping debugger again' printNL.
                     aDebugger unstep.
                     aDebugger setLabelFor:aString in:active.
+                    aDebugger mayProceed:mayProceed.
                     ^ aDebugger enter:aContext select:nil.
                 ]
             ]
         ]
     ].
 
-    ^ self enterUnconditional:aContext withMessage:aString
+    ^ self enterUnconditional:aContext withMessage:aString mayProceed:mayProceed
 
     "Modified: / 30.10.1997 / 21:09:12 / cg"
 !
 
-enterUnconditional:aContext withMessage:aString
+enterUnconditional:aContext withMessage:aString mayProceed:mayProceed
     "enter a debugger - do not check for recursive invocation"
 
     |aDebugger breakpointSignal proc|
@@ -184,11 +173,13 @@
             ex proceed
         ] do:[
             aDebugger := self new.
+            aDebugger mayProceed:mayProceed.
             aDebugger setLabelFor:aString in:proc.
             aDebugger enter:aContext select:nil.
         ]
     ] ifFalse:[
         aDebugger := self new.
+        aDebugger mayProceed:mayProceed.
         aDebugger setLabelFor:aString in:proc.
         aDebugger enter:aContext select:nil.
     ].
@@ -199,15 +190,6 @@
     "Modified: / 30.10.1997 / 21:10:55 / cg"
 !
 
-enterWithMessage:aString
-    "the standard way of entering the debugger - sent from Objects
-     error- and halt messages"
-
-    ^ self enter:(thisContext sender) withMessage:aString
-
-    "Debugger enterWithMessage:'hi there'"
-!
-
 new
     "return a new DebugView - return a cached debugger if it already
      exists"
@@ -515,26 +497,6 @@
 
 !DebugView methodsFor:'basic'!
 
-enter
-    "enter the debugger - on the sending context"
-
-    |where|
-
-    busy := true.
-
-    where := thisContext.      "enter"
-    where := where sender.     "the calling context"
-    where notNil ifTrue:[
-        (where receiver == DebugView) ifTrue:[
-            where := where sender
-        ]
-        "where is now interrupted methods context"
-    ].
-    ^ self enter:where select:nil
-
-    "Modified: / 30.10.1997 / 21:11:29 / cg"
-!
-
 enter:aContext select:initialSelectionOrNil
     "enter the debugger - get and display the context, then start an
      exclusive event loop on top of eveything else"
@@ -715,6 +677,14 @@
         ]
     ].
 
+    mayProceed == false ifTrue:[
+        continueButton disable.
+        m notNil ifTrue:[m disable:#doContinue].
+    ] ifFalse:[
+        continueButton enable.
+        m notNil ifTrue:[m enable:#doContinue]
+    ].
+
     "
      drawableId is nil, if this is a new debugger. Then do a realize.
      Otherwise, its probably better to do a map, which shows the
@@ -2734,6 +2704,10 @@
     self setContext:(inspectedProcess suspendedContext).
 !
 
+mayProceed:aBoolean
+    mayProceed := aBoolean
+!
+
 processPerform:aMessage
     "do something, then update the context list"
 
@@ -3432,7 +3406,10 @@
                         values:#( #proceed #cancel #debug ) 
                         default:#cancel.
             answer == #debug ifTrue:[
-                Debugger enterUnconditional:(ex suspendedContext) withMessage:'error in debugger: ' , ex errorString.
+                Debugger 
+                    enterUnconditional:(ex suspendedContext) 
+                    withMessage:'error in debugger: ' , ex errorString
+                    mayProceed:true.
                 ex proceed.
             ].
             answer == #proceed ifTrue:[
@@ -3955,6 +3932,6 @@
 !DebugView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.235 1999-07-31 14:34:09 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.236 1999-08-04 15:07:36 cg Exp $'
 ! !
 DebugView initialize!