Fix for Bug 10689, binaries disappearing when added to the Executables view.
authorstechong
Wed, 24 Feb 2010 15:38:39 -0600
changeset 135 6f8730b7758d
parent 133 996f2f4e33c7
child 137 f800d58f08b0
Fix for Bug 10689, binaries disappearing when added to the Executables view.
cdt/cdt_6_0_x/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/ExecutablesManager.java
cdt/cdt_6_0_x/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/IProjectExecutablesProvider.java
cdt/cdt_6_0_x/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/StandardExecutableProvider.java
--- a/cdt/cdt_6_0_x/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/ExecutablesManager.java	Wed Feb 10 13:34:53 2010 -0600
+++ b/cdt/cdt_6_0_x/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/ExecutablesManager.java	Wed Feb 24 15:38:39 2010 -0600
@@ -104,7 +104,10 @@
 
 					// store the list of executables for this project
 					synchronized (executablesMap) {
-						executablesMap.put(project, provider.getExecutables(project, subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE)));
+						List<Executable> executables = provider.getExecutables(project, subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE));
+						if (executables != null) {
+							executablesMap.put(project, executables);
+						}
 					}
 				}
 			}
--- a/cdt/cdt_6_0_x/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/IProjectExecutablesProvider.java	Wed Feb 10 13:34:53 2010 -0600
+++ b/cdt/cdt_6_0_x/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/IProjectExecutablesProvider.java	Wed Feb 24 15:38:39 2010 -0600
@@ -38,7 +38,7 @@
 	 * Get the list of executables for the given project
 	 * @param project the project to get the executables for
 	 * @param monitor progress monitor
-	 * @return the list of executables (which may be empty)
+	 * @return the list of executables (which may be empty), or null if request is cancelled
 	 */
 	List<Executable> getExecutables(IProject project, IProgressMonitor monitor);
 
--- a/cdt/cdt_6_0_x/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/StandardExecutableProvider.java	Wed Feb 10 13:34:53 2010 -0600
+++ b/cdt/cdt_6_0_x/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/executables/StandardExecutableProvider.java	Wed Feb 24 15:38:39 2010 -0600
@@ -55,7 +55,7 @@
 
 			for (IBinary binary : binaries) {
 				if (progress.isCanceled()) {
-					break;
+					return null;
 				}
 
 				if (binary.isExecutable() || binary.isSharedLib()) {