Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-debug-dev] MinGW and CDT

There is an ongoing discussion on whether MinGW GDB should use ";" or
":" for path seperator. It looks like the path seperator for MinGW
will end up being ";" since MinGW uses Windows paths.

http://sources.redhat.com/ml/gdb-patches/2006-06/msg00243.html


Attached is a first cut for a patch(ready for comments, but not ready
for committing) that makes it easier for plugin to decide path
seperators via a simple entry in the command factory.

NB! Eclipse launching a CygWin session runs under Windows, but should
be use ":" as path seperator.

Comments?


--
Øyvind Harboe
http://www.zylin.com
### Eclipse Workspace Patch 1.0
#P org.eclipse.cdt.debug.mi.core
Index: mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowDirectories.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-releng/all/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowDirectories.java,v
retrieving revision 1.5
diff -u -r1.5 MIGDBShowDirectories.java
--- mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowDirectories.java	27 Jun 2005 15:24:55 -0000	1.5
+++ mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowDirectories.java	18 Jun 2006 19:47:46 -0000
@@ -35,11 +35,15 @@
 		MIInfo info = null;
 		MIOutput out = getMIOutput();
 		if (out != null) {
-			info = new MIGDBShowDirectoriesInfo(out);
+			info = createMIGDBShowDirectoriesInfo(out);
 			if (info.isError()) {
 				throwMIException(info, out);
 			}
 		}
 		return info;
 	}
+
+	protected MIGDBShowDirectoriesInfo createMIGDBShowDirectoriesInfo(MIOutput out) {
+		return new MIGDBShowDirectoriesInfo(out);
+	}
 }
Index: mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowDirectoriesInfo.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-releng/all/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowDirectoriesInfo.java,v
retrieving revision 1.5
diff -u -r1.5 MIGDBShowDirectoriesInfo.java
--- mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowDirectoriesInfo.java	23 Jun 2005 16:00:59 -0000	1.5
+++ mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowDirectoriesInfo.java	18 Jun 2006 19:47:46 -0000
@@ -42,7 +42,7 @@
 					MIStreamRecord cons = (MIStreamRecord)oobs[i];
 					String str = cons.getString();
 					if (str.startsWith("Source directories searched:")) { //$NON-NLS-1$
-						int j = str.indexOf(':');
+						int j = str.indexOf(getPathSeperator());
 						if (j != -1) {
 							String sub = str.substring(j + 1).trim();
 							parseDirectories(sub);
@@ -54,7 +54,7 @@
 	}
 
 	void parseDirectories(String d) {
-		String sep = System.getProperty("path.separator", ":"); //$NON-NLS-1$ //$NON-NLS-2$
+		String sep = getPathSeperator(); //$NON-NLS-1$ //$NON-NLS-2$
 		StringTokenizer st = new StringTokenizer(d, sep);
 		int count = st.countTokens();
 		dirs = new String[count];
@@ -62,4 +62,8 @@
 			dirs[i] = st.nextToken();
 		}
 	}
+
+	protected String getPathSeperator() {
+		return System.getProperty("path.separator", ":");
+	}
 }



Back to the top