MiniDebugger.st
changeset 25251 61b643937051
parent 25245 50a569eaaba3
child 25253 c0422fc32176
--- a/MiniDebugger.st	Thu Feb 06 21:18:18 2020 +0100
+++ b/MiniDebugger.st	Thu Feb 06 21:24:26 2020 +0100
@@ -683,6 +683,7 @@
 
     |id proc bool|
 
+    "/ care for argument after command character (pid or '+' or '-')
     commandArg notEmptyOrNil ifTrue:[
         id := Number readFrom:commandArg onError:nil.
         id notNil ifTrue:[
@@ -701,17 +702,20 @@
         ]
     ].
 
+    ('wbTQ' includes:cmd) ifTrue:[
+        (id notNil and:[proc isNil]) ifTrue:[
+            'no process with id: ' _errorPrint. id _errorPrintCR.
+            ^ false.
+        ].
+    ].
+
     (cmd == $w) ifTrue:[
         proc notNil ifTrue:[
             '-------- walkback of process ' _errorPrint. id _errorPrint. ' -------' _errorPrintCR.
             self printBacktraceFrom:(proc suspendedContext)
         ] ifFalse:[
-            id notNil ifTrue:[
-                'no process with id: ' _errorPrint. id _errorPrintCR.
-            ] ifFalse:[
-                '-------- walkback of current process -------' _errorPrintCR.
-                self printBacktraceFrom:(self getContext)
-            ]
+            '-------- walkback of current process -------' _errorPrintCR.
+            self printBacktraceFrom:(self getContext)
         ].
         ^ false
     ].
@@ -726,16 +730,12 @@
                 "/ proc suspendedContext fullPrintAllOn:(Processor activeProcess environmentAt:#Stderr)
             ].    
         ] ifFalse:[
-            id notNil ifTrue:[
-                'no process with id: ' _errorPrint. id _errorPrintCR.
+            '-------- VM walkback of current process -------' _errorPrintCR.
+            (Processor activeProcess environmentAt:#Stderr ifAbsent:Stderr) == Stderr ifTrue:[
+                ObjectMemory printStackBacktrace
             ] ifFalse:[
-                '-------- VM walkback of current process -------' _errorPrintCR.
-                Processor activeProcess stderr == Stderr ifTrue:[
-                    ObjectMemory printStackBacktrace
-                ] ifFalse:[
-                    "/ self printBacktraceFrom:(self getContext)
-                    thisContext fullPrintAllOn:(Processor activeProcess stderr)
-                ]
+                "/ self printBacktraceFrom:(self getContext)
+                thisContext fullPrintAllOn:(Processor activeProcess environmentAt:#Stderr)
             ]
         ].
         ^ false
@@ -834,11 +834,7 @@
         proc notNil ifTrue:[
             proc terminate.
         ] ifFalse:[
-            id notNil ifTrue:[
-                'no process with id: ' _errorPrint. id _errorPrintCR.
-            ] ifFalse:[
-                Processor terminateActive
-            ]
+            Processor terminateActive
         ].
         ^ false
     ].
@@ -868,11 +864,7 @@
         proc notNil ifTrue:[
             proc terminateNoSignal.
         ] ifFalse:[
-            id notNil ifTrue:[
-                'no process with id: ' _errorPrint. id _errorPrintCR.
-            ] ifFalse:[
-                Processor terminateActiveNoSignal
-            ]
+            Processor terminateActiveNoSignal
         ].
         ^ false
     ].
@@ -936,7 +928,6 @@
 
     "Created: / 29-09-2011 / 08:58:47 / cg"
     "Modified: / 15-09-2017 / 14:30:48 / cg"
-    "Modified: / 05-02-2020 / 17:05:07 / Stefan Vogel"
 !
 
 getCommand:prompt