Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Fix 42501 and CBuilder

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/ChangeLog,v
retrieving revision 1.140
diff -u -r1.140 ChangeLog
--- ChangeLog	4 Sep 2003 14:39:15 -0000	1.140
+++ ChangeLog	4 Sep 2003 15:33:14 -0000
@@ -1,3 +1,16 @@
+2003-09-04 Alain Magloire
+
+	The IProgressMonitor.setCancelled() is incorrect, it tries to access
+	widget withour wrapping things in Display.async().  Even if the IProgressMonitor
+	is a "core" Class.  We workaround this by not using the method.
+
+	PR 42501.  When the clock setting is incorrect GNU Make will throw something like:
+		make: *** Warning: clock File`...` has modification in the future
+	It was show as an error.  Thanks to Brent for the catch.
+
+	* src/org/eclipse/cdt/internal/core/CBuilder.java
+	* src/org/eclipse/cdt/internal/core/errorparsers/MakeErrorParser.java
+	
 2003-09-04 Hoda Amer
 	- Changed the ASTExpression of the complete package to store the
 	whole ITOkenDuple for the typeId instead of just the string.
Index: src/org/eclipse/cdt/internal/core/CBuilder.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CBuilder.java,v
retrieving revision 1.17
diff -u -r1.17 CBuilder.java
--- src/org/eclipse/cdt/internal/core/CBuilder.java	23 Dec 2002 18:55:22 -0000	1.17
+++ src/org/eclipse/cdt/internal/core/CBuilder.java	4 Sep 2003 15:33:15 -0000
@@ -93,7 +93,6 @@
 
 	private boolean invokeMake(boolean fullBuild, IProgressMonitor monitor) {
 		boolean isClean = false;
-		boolean isCanceled = false;
 		IProject currProject = getProject();
 		SubProgressMonitor subMonitor = null;
 
@@ -157,13 +156,13 @@
 					if (launcher.waitAndRead(stdout, stderr, subMonitor) != CommandLauncher.OK)
 						errMsg = launcher.getErrorMessage();
 
-					isCanceled = monitor.isCanceled();
-					monitor.setCanceled(false);
-					subMonitor = new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN);
-					subMonitor.subTask("Refresh From Local");
+					subMonitor.setTaskName("Refresh From Local");
 
 					try {
-						currProject.refreshLocal(IResource.DEPTH_INFINITE, subMonitor);
+						// do not allow the cancel of the refresh, since the builder is external
+						// to Eclipse files may have been created/modified and we will be out-of-sync
+						// The caveat is for hugue projects, it may take sometimes at every build.
+						currProject.refreshLocal(IResource.DEPTH_INFINITE, null);
 					} catch (CoreException e) {
 					}
 
@@ -188,7 +187,6 @@
 				epm.reportProblems();
 
 				subMonitor.done();
-				monitor.setCanceled(isCanceled);
 			}
 		} catch (Exception e) {
 			CCorePlugin.log(e);
Index: src/org/eclipse/cdt/internal/errorparsers/MakeErrorParser.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/MakeErrorParser.java,v
retrieving revision 1.5
diff -u -r1.5 MakeErrorParser.java
--- src/org/eclipse/cdt/internal/errorparsers/MakeErrorParser.java	20 Dec 2002 21:14:07 -0000	1.5
+++ src/org/eclipse/cdt/internal/errorparsers/MakeErrorParser.java	4 Sep 2003 15:33:15 -0000
@@ -17,23 +17,26 @@
 	
 	static int getDirectoryLevel(String line) {
 		int s = line.indexOf('[');
+		int num = 0;
 		if (s != -1) {
 			int e = line.indexOf(']');
-			String number = line.substring(s + 1, e);		
-			int num= Integer.parseInt(number);
-			return num;
+			String number = line.substring(s + 1, e).trim();		
+			try {
+				num = Integer.parseInt(number);
+			} catch (NumberFormatException exc) {
+			}
 		}
-		return 0;
+		return num;
 	}
 	
 	public boolean processLine(String line, ErrorParserManager eoParser) {
 		// make\[[0-9]*\]:  error_desc
 		int firstColon= line.indexOf(':');
-		if (firstColon != -1 && line.startsWith("make")) {
+		if (firstColon != -1 && line.startsWith("make")) { //$NON-NLS-1$
 			boolean enter = false;
-			String msg= line.substring(firstColon + 1);		
-			if ((enter = msg.startsWith(" Entering directory")) ||
-			    (msg.startsWith(" Leaving directory"))) {
+			String msg= line.substring(firstColon + 1).trim();		
+			if ((enter = msg.startsWith("Entering directory")) || //$NON-NLS-1$
+			    (msg.startsWith("Leaving directory"))) { //$NON-NLS-1$
 			    int s = msg.indexOf('`');
 			    int e = msg.indexOf('\'');
 			    if (s != -1 && e != -1) {
@@ -54,8 +57,17 @@
 			    		/* Could check to see if they match */
 			    	}
 				}
-			} else if (msg.startsWith(" ***")) {
-				eoParser.generateMarker(null, -1, msg, IMarkerGenerator.SEVERITY_ERROR_BUILD, null);
+			} else if (msg.startsWith("***")) { //$NON-NLS-1$
+				boolean warning = false;
+				if (msg.length() > 4) {
+					String s = msg.substring(3).trim();
+					warning = s.startsWith("Warning"); //$NON-NLS-1$
+				}
+				if (warning) {
+					eoParser.generateMarker(null, -1, msg, IMarkerGenerator.SEVERITY_WARNING, null);
+				} else {
+					eoParser.generateMarker(null, -1, msg, IMarkerGenerator.SEVERITY_ERROR_BUILD, null);
+				}
 			}
 		}
 		return false;



Back to the top