Workaround: assume native target when issuing `run` or `attach` commands using simple console
authorJan Vrany <jan.vrany@fit.cvut.cz>
Wed, 13 Mar 2019 13:54:14 +0000
changeset 148 7d2d523173af
parent 147 4087090b3581
child 149 adaffe052a41
Workaround: assume native target when issuing `run` or `attach` commands using simple console Background command execution is not supported by some targets, most notably by Windows native target. However, at the point we have to decided whether use background execution or not, we don't know which target will get connected and therefore we cannot check target features. So, make a guess and assime we gonna use native target. This is so bad, this *absolutely* has to be fixed somehow.
VDBSimpleDebuggerConsoleApplication.st
--- a/VDBSimpleDebuggerConsoleApplication.st	Wed Jan 30 11:45:37 2019 +0000
+++ b/VDBSimpleDebuggerConsoleApplication.st	Wed Mar 13 13:54:14 2019 +0000
@@ -96,13 +96,20 @@
         "/
         "/ 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.      
-        ].
+        (#('run' 'attach') includes: cmd operation) ifTrue:[ 
+            "/ Sigh, background command execution is not supported by some
+            "/ targets, most notably by Windows native target. However, at this
+            "/ point we don't know which target we will use therefore we cannot
+            "/ check target features. 
+            "/ 
+            "/ Therefore make a guess and assime we gonna use native target.
+            "/ This is so bad, this *absolutely* has to be fixed somehow.
+            cmd runOnBackground: debugger nativeTargetHasFeatureAsync.
+        ] ifFalse:[ (#('step' 'stepi' 'next' 'nexti' 'continue' 'until' 'finish' 'rn' 'rns' 'rs' 'rsi' 'rc') includes: cmd operation) ifTrue:[ 
+            debugger hasFeatureAsync ifTrue:[
+                cmd runOnBackground: true.      
+            ].
+        ]].
     ].
     consoleView readOnly:true.  
     debugger send:cmd andWithResultDo:[:result| 
@@ -115,6 +122,7 @@
 
     "Created: / 25-01-2019 / 12:12:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified (format): / 29-01-2019 / 09:37:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (format): / 13-03-2019 / 12:56:04 / jv"
 ! !
 
 !VDBSimpleDebuggerConsoleApplication methodsFor:'aspects'!