Fix `GDBStXSimpleProcess` to load user's `.gdbinit`
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 25 Jun 2019 21:21:21 +0100
changeset 198 2078a57c6783
parent 197 b4d1befee03a
child 199 cb411138b295
Fix `GDBStXSimpleProcess` to load user's `.gdbinit` We must not pass `-nx` option that inhibit this. Moreover, GDB looks to `HOME` environment which on stock Windows may not be defined. To avoid surprises when used on Windows, define `HOME` environment - if not already - as path to user profile before actually launching GDB.
GDBStXSimpleProcess.st
--- a/GDBStXSimpleProcess.st	Tue Jun 25 15:28:46 2019 +0100
+++ b/GDBStXSimpleProcess.st	Tue Jun 25 21:21:21 2019 +0100
@@ -196,13 +196,12 @@
 
     command := aString.
     argv := (self command2argv: command) ,
-            ((Array new: 6)
+            ((Array new: 5)
              at: 1 put: '-q';
-             at: 2 put: '-nx';
-             at: 3 put: '--interpreter';
-             at: 4 put: 'mi';
-             at: 5 put: '-ex';
-             at: 6 put: 'set new-console on';
+             at: 2 put: '--interpreter';
+             at: 3 put: 'mi';
+             at: 4 put: '-ex';
+             at: 5 put: 'set new-console on';
              yourself).
 
     inputPipe := NonPositionableExternalStream makePipe.
@@ -211,7 +210,13 @@
     output := outputPipe first.
     errorPipe := NonPositionableExternalStream makePipe.
     error := outputPipe first.
-    
+
+    "/
+    OperatingSystem isMSWINDOWSlike ifTrue:[ 
+        (OperatingSystem getEnvironment:'HOME') isNil ifTrue:[ 
+            OperatingSystem setEnvironment:'HOME' to: Filename homeDirectory pathName
+        ].
+    ].
 
     Processor 
         monitor:[
@@ -246,6 +251,7 @@
 
     "Created: / 12-12-2018 / 20:13:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 11-06-2019 / 11:45:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (comment): / 25-06-2019 / 21:10:02 / jv"
 !
 
 release