Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] MI Patch for GDB on cygwin

Title: MI Patch for GDB on cygwin

My first patch!  GDB was experiencing a timeout on startup when running with cygwin.  This, I think, fixes it.  Please review and apply if you like it.

Cheers,
Doug

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/ChangeLog,v
retrieving revision 1.33
diff -u -r1.33 ChangeLog
--- ChangeLog   14 Nov 2002 21:09:31 -0000      1.33
+++ ChangeLog   15 Nov 2002 19:13:28 -0000
@@ -1,3 +1,9 @@
+2002-11-15 Doug Schaefer
+
+       * MIEnvironmentDirectory.java: To avoid the timeout that is happening
+       when starting a debug session on cygwin gdb, the paths in this command
+       need to be cygwin-ized, no drive letter and slashes the Unix way.
+      
 2002-11-14 Alain Magloire
 
        This is needed in post-mortem, application doing a
Index: src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentDirectory.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentDirectory.java,v

retrieving revision 1.3
diff -u -r1.3 MIEnvironmentDirectory.java
--- src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentDirectory.java       4 Sep 2002 23:11:11 -0000       1.3
+++ src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentDirectory.java       15 Nov 2002 19:13:29 -0000
@@ -16,7 +16,20 @@
 public class MIEnvironmentDirectory extends MICommand
 {
        public MIEnvironmentDirectory(String[] paths) {
-               super("-environment-directory", paths);
+               super("-environment-directory");
+              
+               String[] newpaths = new String[paths.length];
+              
+               // For cygwin, need to convert the slashes to the other way and convert the drive letter
+               for (int i = 0; i < paths.length; i++) {
+                       String path = paths[i].replace('\\', '/');
+                      
+                       if (path.charAt(1) == ':')
+                               path = "/cygdrive/" + path.charAt(0) + path.substring(2);
+                      
+                       newpaths[i] = path;
+               }
+              
+               setParameters(newpaths);
        }
-
 }


Back to the top