Use inferior PTY only if supported
authorJan Vrany <jan.vrany@fit.cvut.cz>
Wed, 16 Jan 2019 23:38:20 +0000
changeset 167 6da3d808c7cc
parent 166 5cb191425081
child 168 822cd61a882e
Use inferior PTY only if supported ...i.e., when running GDB locally on UNIX-like systems. Note, that the fact that `libgdbs` is running on UNIX-like system does not necessarily mean PTYs can be used - GDB still can run on remote machine via SSH.
GDBConnection.st
GDBProcess.st
GDBStXUnixProcess.st
--- a/GDBConnection.st	Tue Jan 01 23:44:26 2019 +0000
+++ b/GDBConnection.st	Wed Jan 16 23:38:20 2019 +0000
@@ -345,7 +345,7 @@
 
 initializeWithProcess:aGDBProcess 
     process := aGDBProcess.
-    OperatingSystem isUNIXlike ifTrue:[
+    (OperatingSystem isUNIXlike and:[aGDBProcess canUsePTY]) ifTrue:[
         inferiorPTY := GDBPTY new.
     ].
     eventQueue := OrderedCollection new.
@@ -360,8 +360,8 @@
     aGDBProcess connection:self.
 
     "Created: / 20-06-2014 / 21:40:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 18-09-2014 / 00:11:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 12-01-2018 / 00:12:25 / jv"
+    "Modified: / 16-01-2019 / 23:02:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 release
--- a/GDBProcess.st	Tue Jan 01 23:44:26 2019 +0000
+++ b/GDBProcess.st	Wed Jan 16 23:38:20 2019 +0000
@@ -244,6 +244,16 @@
     "Modified (comment): / 17-10-2018 / 22:12:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!GDBProcess methodsFor:'queries'!
+
+canUsePTY
+    "Return true if PTYs can be used with this process, false otherwise"
+
+    ^ false
+
+    "Created: / 16-01-2019 / 23:02:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !GDBProcess class methodsFor:'documentation'!
 
 version_HG
--- a/GDBStXUnixProcess.st	Tue Jan 01 23:44:26 2019 +0000
+++ b/GDBStXUnixProcess.st	Wed Jan 16 23:38:20 2019 +0000
@@ -208,6 +208,16 @@
     "Modified: / 15-12-2017 / 23:59:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!GDBStXUnixProcess methodsFor:'queries'!
+
+canUsePTY
+    "Return true if PTYs can be used with this process, false otherwise"
+
+    ^ true
+
+    "Created: / 16-01-2019 / 23:02:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !GDBStXUnixProcess class methodsFor:'documentation'!
 
 version_HG