GDBUnixProcess.st
changeset 149 0db2ccc6da7b
parent 138 5d6ef1b8f539
--- a/GDBUnixProcess.st	Wed Oct 03 13:00:25 2018 +0100
+++ b/GDBUnixProcess.st	Wed Oct 03 22:23:19 2018 +0100
@@ -73,16 +73,21 @@
 !GDBUnixProcess methodsFor:'initialization & release'!
 
 initialize
-    | conpty dbgpty args |
+    | exe conpty dbgpty args |
+
+    exe := self class gdbExecutable.
+    (exe isNil or:[ exe asFilename isExecutable not ]) ifTrue:[ 
+        GDBError raiseErrorString: 'Could not find gdb, please set path to gdb using GDBProcess class >> gdbExecutable:'.
+        ^ self.
+    ].
 
     conpty := GDBPTY new.
-
     dbgpty := GDBPTY new.
     dbgpty setLocalEcho: false.
     dbgpty setOutputCRLF: false.
 
     args := (Array new: 6)
-                at: 1 put: self class gdbExecutable ? '/usr/bin/gdb';
+                at: 1 put: exe;
                 at: 2 put: '-q';
                 at: 3 put: '-ex';
                 at: 4 put: 'new-ui mi ', dbgpty name;
@@ -116,7 +121,7 @@
         self error:'Failed to launch gdb'.
     ].
 
-    "Modified: / 03-09-2018 / 09:23:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-10-2018 / 22:22:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 release