Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] ErrorParsers fixes

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/ChangeLog,v
retrieving revision 1.50
diff -u -r1.50 ChangeLog
--- ChangeLog	13 Dec 2002 16:33:40 -0000	1.50
+++ ChangeLog	19 Dec 2002 19:19:03 -0000
@@ -1,3 +1,14 @@
+2002-12-19 Alain Magloire
+
+	* src/org/eclipse/cdt/core/ErrorParserManager.java (findFilePath):
+	The workspace will throw an Exception if the file
+	is not within the workspace, catch it.
+	(getWorkingDirectory): fallback to the location
+	of the project if no working directory.
+
+	* src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java (processLine):
+	Ignore errors that does not match the pattern.
+
 2002-12-13 Alain Magloire
 
 	* src/org/eclipse/cdt/core/CommandLauncher.java (waitAndRead):
Index: src/org/eclipse/cdt/core/ErrorParserManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java,v
retrieving revision 1.7
diff -u -r1.7 ErrorParserManager.java
--- src/org/eclipse/cdt/core/ErrorParserManager.java	24 Nov 2002 16:02:01 -0000	1.7
+++ src/org/eclipse/cdt/core/ErrorParserManager.java	19 Dec 2002 19:19:03 -0000
@@ -88,7 +88,9 @@
 		if (fDirectoryStack.size() != 0) {
 			return (IPath) fDirectoryStack.lastElement();
 		}
-		return new Path("");
+		// Fallback to the Project Location
+		// FIXME: if the build did not start in the Project ?
+		return fProject.getLocation();
 	}
 
 	public void pushDirectory(IPath dir) {
@@ -244,7 +246,14 @@
 		} else {
 			path = (IPath) getWorkingDirectory().append(filePath);
 		}
-		IFile file = (path.isAbsolute()) ? fProject.getWorkspace().getRoot().getFileForLocation(path) : fProject.getFile(path);
+
+		IFile file = null;
+		// The workspace may throw an IllegalArgumentException
+		// Catch it and the parser will fallback to scan the entire project.
+		try {
+			file = (path.isAbsolute()) ? fProject.getWorkspace().getRoot().getFileForLocation(path) : fProject.getFile(path);
+		} catch (Exception e) {
+		}
 		return (file != null && file.exists()) ? file : null;
 	}
 
Index: src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java,v
retrieving revision 1.7
diff -u -r1.7 GCCErrorParser.java
--- src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java	15 Nov 2002 14:40:00 -0000	1.7
+++ src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java	19 Dec 2002 19:19:03 -0000
@@ -50,16 +50,8 @@
 					}
 
 					if (num == -1) {
-						// Maybe a bad option error or cc1(plus) error
-						if (fileName.startsWith("cc") || fileName.startsWith("gcc")
-							|| fileName.startsWith("qcc") || fileName.startsWith("QCC")) {
-							// do nothing;
-							if(line.indexOf("caught signal") != -1) {
-								return false;
-							}
-						} else {
-							return false;
-						}
+						// Bail out not recognizable format. i.e. no line numbers
+						return false;
 					} else {
 						/* Then check for the column  */
 						int thirdColon= line.indexOf(':', secondColon + 1);



Back to the top