Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2010-11-28 16:17:37 -0500
committerSergey Prigogin2010-11-28 16:17:37 -0500
commit93025a22fb992bee375a618484edf35b795366fd (patch)
tree15848be35d6b7e38f4e71e3a5c186d06364a12e4
parent3e56b321b1c86bc5c5e80dffe91d9a32bfd65d15 (diff)
downloadorg.eclipse.cdt-93025a22fb992bee375a618484edf35b795366fd.tar.gz
org.eclipse.cdt-93025a22fb992bee375a618484edf35b795366fd.tar.xz
org.eclipse.cdt-93025a22fb992bee375a618484edf35b795366fd.zip
Bug 328012 - UI freezes when opening a launch configuration if the binary is on a slow file system
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CMainTab.java27
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchMessages.properties1
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CAbstractMainTab.java3
3 files changed, 8 insertions, 23 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CMainTab.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CMainTab.java
index e999027fac..f268e9c194 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CMainTab.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CMainTab.java
@@ -356,7 +356,6 @@ public class CMainTab extends CAbstractMainTab {
*/
@Override
protected void handleSearchButtonSelected() {
-
if (getCProject() == null) {
MessageDialog.openInformation(getShell(), LaunchMessages.getString("CMainTab.Project_required"), //$NON-NLS-1$
LaunchMessages.getString("CMainTab.Enter_project_before_searching_for_program")); //$NON-NLS-1$
@@ -364,7 +363,6 @@ public class CMainTab extends CAbstractMainTab {
}
ILabelProvider programLabelProvider = new CElementLabelProvider() {
-
@Override
public String getText(Object element) {
if (element instanceof IBinary) {
@@ -395,7 +393,6 @@ public class CMainTab extends CAbstractMainTab {
};
ILabelProvider qualifierLabelProvider = new CElementLabelProvider() {
-
@Override
public String getText(Object element) {
if (element instanceof IBinary) {
@@ -422,7 +419,6 @@ public class CMainTab extends CAbstractMainTab {
IBinary binary = (IBinary)dialog.getFirstResult();
fProgText.setText(binary.getResource().getProjectRelativePath().toString());
}
-
}
/*
@@ -432,7 +428,6 @@ public class CMainTab extends CAbstractMainTab {
*/
@Override
public boolean isValid(ILaunchConfiguration config) {
-
setErrorMessage(null);
setMessage(null);
@@ -474,16 +469,9 @@ public class CMainTab extends CAbstractMainTab {
return false;
}
}
- try {
- if (!isBinary(project, exePath)) {
- setErrorMessage(LaunchMessages.getString("CMainTab.Program_is_not_a_recongnized_executable")); //$NON-NLS-1$
- return false;
- }
- } catch (CoreException e) {
- GdbUIPlugin.log(e);
- setErrorMessage(e.getLocalizedMessage());
- return false;
- }
+ // Notice that we don't check if exePath points to a valid executable since such
+ // check is too expensive to be done on the UI thread.
+ // See "https://bugs.eclipse.org/bugs/show_bug.cgi?id=328012".
}
if (fCoreText != null) {
@@ -541,16 +529,13 @@ public class CMainTab extends CAbstractMainTab {
* Set the program name attributes on the working copy based on the ICElement
*/
protected void initializeProgramName(ICElement cElement, ILaunchConfigurationWorkingCopy config) {
-
boolean renamed = false;
- if (!(cElement instanceof IBinary))
- {
+ if (!(cElement instanceof IBinary)) {
cElement = cElement.getCProject();
}
if (cElement instanceof ICProject) {
-
IProject project = cElement.getCProject().getProject();
String name = project.getName();
ICProjectDescription projDes = CCorePlugin.getDefault().getProjectDescription(project);
@@ -590,8 +575,7 @@ public class CMainTab extends CAbstractMainTab {
}
}
- if (!renamed)
- {
+ if (!renamed) {
String name = getLaunchConfigurationDialog().generateName(cElement.getCProject().getElementName());
config.rename(name);
}
@@ -620,5 +604,4 @@ public class CMainTab extends CAbstractMainTab {
public Image getImage() {
return LaunchImages.get(LaunchImages.IMG_VIEW_MAIN_TAB);
}
-
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchMessages.properties b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchMessages.properties
index 94bfbddcad..f324547226 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchMessages.properties
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchMessages.properties
@@ -98,7 +98,6 @@ CMainTab.Search...=Searc&h Project...
CMainTab.Choose_program_to_run=Choose a &program to run:
CMainTab.Choose_program_to_run_from_NAME=Choose a program to run from {0}:
CMainTab.UseTerminal=Connect process input && output to a terminal.
-CMainTab.Program_is_not_a_recongnized_executable=Program is not a recognized executable.
CMaintab.Application_Selection=Application Selection
CMaintab.Core_Selection=Core File Selection
CMaintab.Trace_Selection=Trace File Selection
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CAbstractMainTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CAbstractMainTab.java
index b79349318b..49394fdc9d 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CAbstractMainTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CAbstractMainTab.java
@@ -477,11 +477,14 @@ public abstract class CAbstractMainTab extends CLaunchConfigurationTab {
}
/**
+ * This method is deprecated since LaunchUtils#getBinary(IProject, IPath) is too slow to be
+ * called on the UI thread. See "https://bugs.eclipse.org/bugs/show_bug.cgi?id=328012".
* @param project
* @param exePath
* @return
* @throws CoreException
*/
+ @Deprecated
protected boolean isBinary(IProject project, IPath exePath) throws CoreException {
try {
Boolean binValue = fBinaryExeCache.get(exePath);

Back to the top