Execute CLI execution commands in background mode
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 28 Jan 2019 23:41:53 +0000
changeset 144 315d72d8dc4e
parent 143 df7f89efd39d
child 145 3b9ab4badbff
Execute CLI execution commands in background mode ...if target supports async mode. This allows user to interrupt the program execution, at the very least.
VDBSimpleDebuggerConsoleApplication.st
--- a/VDBSimpleDebuggerConsoleApplication.st	Fri Jan 25 13:33:51 2019 +0000
+++ b/VDBSimpleDebuggerConsoleApplication.st	Mon Jan 28 23:41:53 2019 +0000
@@ -89,8 +89,21 @@
     ].
 
     cmd := GDBCommand parse: aString.
-    cmd isCLICommand ifTrue:[ 
-        cmd runOnBackground: true.  
+    (cmd isCLICommand and:[debugger hasFeatureAsync]) ifTrue:[ 
+        "/ If target supports async execution and if CLI command 
+        "/ is one of the execution commands, run the command in
+        "/ background. This allows user to interrupt it, among
+        "/ other things.
+        "/
+        "/ See GDB manual, Section 5.5.3 Background Execution
+
+        (#('run' 
+           'attach' 
+           'step' 'stepi' 'next' 'nexti' 
+           'continue' 'until' 'finish' 
+           'rn' 'rns' 'rs' 'rsi' 'rc') includes: cmd operation) ifTrue:[ 
+            cmd runOnBackground: true.      
+        ].
     ].
     consoleView readOnly:true.  
     debugger send:cmd andWithResultDo:[:result| 
@@ -102,6 +115,7 @@
     ].
 
     "Created: / 25-01-2019 / 12:12:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 28-01-2019 / 23:00:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !VDBSimpleDebuggerConsoleApplication methodsFor:'aspects'!