#REFACTORING by cg
authorClaus Gittinger <cg@exept.de>
Tue, 27 Dec 2016 11:03:07 +0100
changeset 17188 8f420441108e
parent 17187 3dcae3e757cd
child 17189 da9bbf8ef291
#REFACTORING by cg class: DebugView added: #openDebuggerForProcess: comment/format in: #openOn: changed: #openDebuggerForActiveProcess refactored to get a new utility function: openDebuggerForProcess. which is useful for expecco
DebugView.st
--- a/DebugView.st	Mon Dec 26 15:29:16 2016 +0100
+++ b/DebugView.st	Tue Dec 27 11:03:07 2016 +0100
@@ -758,7 +758,24 @@
      Open debuggers exist when stepping only, as then, the debugger is left open until the step
      is reached, to avoid too much flickering and redrawing on the screen"
 
-    |active|
+    "
+     well, it could be a stepping or sending debugger up there;
+     in this case, return to it. This happens, when a stepping process
+     runs into an error (for example, a halt). In this case, we want the
+     stepping debugger to come up again instead of a new one.
+    "
+    OpenDebuggers notNil ifTrue:[
+        ^ self openDebuggerForProcess:(Processor activeProcess)
+    ].    
+    ^ nil
+
+    "Created: / 06-11-2013 / 20:57:49 / cg"
+!
+
+openDebuggerForProcess:aProcess
+    "if aProcess is being debugged and has an open debugger on it, 
+     then return it, or nil, if there is none.
+     Open debuggers also exist as unmapped windows when single-stepping"
 
     "
      well, it could be a stepping or sending debugger up there;
@@ -767,13 +784,12 @@
      stepping debugger to come up again instead of a new one.
     "
     OpenDebuggers notNil ifTrue:[
-        active := Processor activeProcess.
         OpenDebuggers do:[:aDebugger |
             |debuggersProcess|
 
             (aDebugger notNil and:[aDebugger ~~ 0]) ifTrue:[
                 debuggersProcess := aDebugger inspectedProcess.
-                debuggersProcess == active ifTrue:[
+                debuggersProcess == aProcess ifTrue:[
                     aDebugger device isOpen ifTrue:[
                         DebuggingDebugger == true ifTrue:[
                             'reusing cached debugger' errorPrintCR.
@@ -789,12 +805,10 @@
         ]
     ].
     ^ nil
-
-    "Created: / 06-11-2013 / 20:57:49 / cg"
 !
 
 openOn:aProcess
-    "start a  debugger on aProcess
+    "start a debugger on aProcess
      (actually not more than a good-looking inspector)"
 
     |aDebugger label nm|