Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/launch
diff options
context:
space:
mode:
authorDavid Inglis2004-05-31 14:06:16 -0400
committerDavid Inglis2004-05-31 14:06:16 -0400
commit760c2a22b5ade12b0e192e738b69d0dc523fd625 (patch)
treef69c5beaf1284d9bf792701115a2103afa416dc1 /launch
parent34f6b89386f9e2c88d2b4a6a17f8f16430a2418a (diff)
downloadorg.eclipse.cdt-760c2a22b5ade12b0e192e738b69d0dc523fd625.tar.gz
org.eclipse.cdt-760c2a22b5ade12b0e192e738b69d0dc523fd625.tar.xz
org.eclipse.cdt-760c2a22b5ade12b0e192e738b69d0dc523fd625.zip
fixed update platform filtering
fixed compiler error prompting
Diffstat (limited to 'launch')
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java20
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java11
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/AbstractCDebuggerTab.java3
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java16
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java18
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java27
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CorefileDebuggerTab.java2
7 files changed, 41 insertions, 56 deletions
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java
index 031bb598075..f29d39748ba 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java
@@ -51,8 +51,6 @@ import org.eclipse.debug.core.model.LaunchConfigurationDelegate;
abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegate {
- protected static final IStatus complileErrorPromptStatus = new Status(IStatus.INFO, "org.eclipse.cdt.launch", 202, "", null); //$NON-NLS-1$ //$NON-NLS-2$
-
/**
* The project containing the programs file being launched
*/
@@ -460,22 +458,20 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
File dir = new File(path.toOSString());
if (dir.isDirectory()) {
return dir;
- } else {
- abort(LaunchUIPlugin.getResourceString("AbstractCLaunchDelegate.Working_directory_does_not_exist"), //$NON-NLS-1$
- new FileNotFoundException(LaunchUIPlugin.getFormattedResourceString(
- "AbstractCLaunchDelegate.PROGRAM_PATH_not_found", path.toOSString())), //$NON-NLS-1$
- ICDTLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST);
}
+ abort(LaunchUIPlugin.getResourceString("AbstractCLaunchDelegate.Working_directory_does_not_exist"), //$NON-NLS-1$
+ new FileNotFoundException(LaunchUIPlugin.getFormattedResourceString(
+ "AbstractCLaunchDelegate.PROGRAM_PATH_not_found", path.toOSString())), //$NON-NLS-1$
+ ICDTLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST);
} else {
IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
if (res instanceof IContainer && res.exists()) {
return res.getLocation().toFile();
- } else {
- abort(LaunchUIPlugin.getResourceString("AbstractCLaunchDelegate.Working_directory_does_not_exist"), //$NON-NLS-1$
- new FileNotFoundException(LaunchUIPlugin.getFormattedResourceString(
- "AbstractCLaunchDelegate.PROGRAM_PATH_does_not_exist", path.toOSString())), //$NON-NLS-1$
- ICDTLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST);
}
+ abort(LaunchUIPlugin.getResourceString("AbstractCLaunchDelegate.Working_directory_does_not_exist"), //$NON-NLS-1$
+ new FileNotFoundException(LaunchUIPlugin.getFormattedResourceString(
+ "AbstractCLaunchDelegate.PROGRAM_PATH_does_not_exist", path.toOSString())), //$NON-NLS-1$
+ ICDTLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST);
}
}
return null;
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java
index 170268bc491..60c5465befa 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java
@@ -107,8 +107,8 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut {
// user to choose one.
int candidateCount = candidateConfigs.size();
if (candidateCount < 1) {
- // FIXME: should probably have more filtering here base on
- // the mode, arch, CPU. For now we only support native.
+ String programCPU = bin.getCPU();
+
// Prompt the user if more then 1 debugger.
ICDebugConfiguration debugConfig = null;
ICDebugConfiguration[] debugConfigs = CDebugCorePlugin.getDefault().getDebugConfigurations();
@@ -116,8 +116,11 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut {
String os = Platform.getOS();
for (int i = 0; i < debugConfigs.length; i++) {
String platform = debugConfigs[i].getPlatform();
- if (platform == null || platform.equals(ICDebugConfiguration.PLATFORM_NATIVE) || platform.equals(os)) {
- debugList.add(debugConfigs[i]);
+ if (debugConfigs[i].supportsMode(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)) {
+ if (platform.equals("*") || platform.equals(os)) { //$NON-NLS-1$
+ if (debugConfigs[i].supportsCPU(programCPU))
+ debugList.add(debugConfigs[i]);
+ }
}
}
debugConfigs = (ICDebugConfiguration[]) debugList.toArray(new ICDebugConfiguration[0]);
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/AbstractCDebuggerTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/AbstractCDebuggerTab.java
index 8be9a6231b4..f058f3aff75 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/AbstractCDebuggerTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/AbstractCDebuggerTab.java
@@ -78,9 +78,8 @@ public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab {
ILaunchConfigurationTab tab = getDynamicTab();
if ((super.getErrorMessage() != null) || (tab == null)) {
return super.getErrorMessage();
- } else {
- return tab.getErrorMessage();
}
+ return tab.getErrorMessage();
}
/**
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java
index 3adaf86ba4e..6b6d890f80c 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java
@@ -83,16 +83,14 @@ public class LaunchUIPlugin extends AbstractUIPlugin
public static Shell getShell() {
if (getActiveWorkbenchShell() != null) {
return getActiveWorkbenchShell();
- } else {
- if (debugDialogShell != null) {
- if (!debugDialogShell.isDisposed())
- return debugDialogShell;
- debugDialogShell = null;
- }
- IWorkbenchWindow[] windows = getDefault().getWorkbench()
- .getWorkbenchWindows();
- return windows[0].getShell();
}
+ if (debugDialogShell != null) {
+ if (!debugDialogShell.isDisposed())
+ return debugDialogShell;
+ debugDialogShell = null;
+ }
+ IWorkbenchWindow[] windows = getDefault().getWorkbench().getWorkbenchWindows();
+ return windows[0].getShell();
}
public static void setDialogShell(Shell shell) {
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java
index 55a014eeed8..00cf1b49f54 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java
@@ -14,7 +14,6 @@ import org.eclipse.cdt.debug.core.ICDebugConfiguration;
import org.eclipse.cdt.launch.internal.ui.AbstractCDebuggerTab;
import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.swt.SWT;
@@ -131,7 +130,7 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
protected void loadDebuggerComboBox(ILaunchConfiguration config, String selection) {
ICDebugConfiguration[] debugConfigs;
String configPlatform = getPlatform(config);
- String programCPU = ICDebugConfiguration.PLATFORM_NATIVE;
+ String programCPU = ICDebugConfiguration.CPU_NATIVE;
ICElement ce = getContext(config, configPlatform);
if (ce instanceof IBinary) {
IBinary bin = (IBinary) ce;
@@ -153,9 +152,8 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
if (debugConfigs[i].supportsMode(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)
|| debugConfigs[i].supportsMode(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH)) {
String debuggerPlatform = debugConfigs[i].getPlatform();
- boolean isNative = configPlatform.equals(Platform.getOS());
if (debuggerPlatform.equalsIgnoreCase(configPlatform)
- || (isNative && debuggerPlatform.equalsIgnoreCase(ICDebugConfiguration.PLATFORM_NATIVE))) {
+ || (debuggerPlatform.equalsIgnoreCase("*"))) { //$NON-NLS-1$
if (debugConfigs[i].supportsCPU(programCPU)) {
fDCombo.add(debugConfigs[i].getName());
fDCombo.setData(Integer.toString(x), debugConfigs[i]);
@@ -176,7 +174,7 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
//The behaviour is undefined for if the callbacks should be triggered for this,
//so to avoid unnecessary confusion, we force an update.
updateComboFromSelection();
- fDCombo.getParent().layout(true);
+ getControl().getParent().layout(true);
}
protected void updateComboFromSelection() {
@@ -218,9 +216,7 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
super.activated(workingCopy);
try {
String id = workingCopy.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, ""); //$NON-NLS-1$
- if (getDebugConfig() == null || !getDebugConfig().getID().equals(id) || !validateDebuggerConfig(workingCopy)) {
- loadDebuggerComboBox(workingCopy, id);
- }
+ loadDebuggerComboBox(workingCopy, id);
} catch (CoreException e) {
}
}
@@ -283,10 +279,9 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
}
private boolean validateDebuggerConfig(ILaunchConfiguration config) {
- String platform = getPlatform(config);
ICElement ce = getContext(config, null);
String projectPlatform = getPlatform(config);
- String projectCPU = ICDebugConfiguration.PLATFORM_NATIVE;
+ String projectCPU = ICDebugConfiguration.CPU_NATIVE;
if (ce != null) {
if (ce instanceof IBinary) {
IBinary bin = (IBinary) ce;
@@ -298,9 +293,8 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
return false;
}
String debuggerPlatform = debugConfig.getPlatform();
- boolean isNative = platform.equals(projectPlatform);
if (debuggerPlatform.equalsIgnoreCase(projectPlatform)
- || (isNative && debuggerPlatform.equalsIgnoreCase(ICDebugConfiguration.PLATFORM_NATIVE))) {
+ || (debuggerPlatform.equalsIgnoreCase("*"))) { //$NON-NLS-1$
if (debugConfig.supportsCPU(projectCPU)) {
return true;
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
index 04f990f0f84..6efb19a7fbb 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
@@ -15,7 +15,6 @@ import org.eclipse.cdt.core.model.IBinary;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.debug.core.ICDebugConfiguration;
import org.eclipse.cdt.internal.ui.CElementImageProvider;
import org.eclipse.cdt.internal.ui.CPluginImages;
import org.eclipse.cdt.launch.internal.ui.LaunchImages;
@@ -29,7 +28,6 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
@@ -317,18 +315,17 @@ public class CMainTab extends CLaunchConfigurationTab {
public IStatus validate(Object [] selection) {
if(selection.length == 0 || !(selection[0] instanceof IFile)) {
return new Status(IStatus.ERROR, LaunchUIPlugin.getUniqueIdentifier(), 1, LaunchUIPlugin.getResourceString("CMainTab.Selection_must_be_file"), null); //$NON-NLS-1$
- } else {
- try {
- ICElement celement = cproject.findElement(((IFile)selection[0]).getProjectRelativePath());
- if(celement == null ||
- (celement.getElementType() != ICElement.C_BINARY && celement.getElementType() != ICElement.C_ARCHIVE)) {
- return new Status(IStatus.ERROR, LaunchUIPlugin.getUniqueIdentifier(), 1, LaunchUIPlugin.getResourceString("CMainTab.Selection_must_be_binary_file"), null); //$NON-NLS-1$
- }
-
- return new Status(IStatus.OK, LaunchUIPlugin.getUniqueIdentifier(), IStatus.OK, celement.getResource().getName(), null);
- } catch(Exception ex) {
- return new Status(IStatus.ERROR, LaunchUIPlugin.PLUGIN_ID, 1, LaunchUIPlugin.getResourceString("CMainTab.Selection_must_be_binary_file"), null); //$NON-NLS-1$
+ }
+ try {
+ ICElement celement = cproject.findElement(((IFile)selection[0]).getProjectRelativePath());
+ if(celement == null ||
+ (celement.getElementType() != ICElement.C_BINARY && celement.getElementType() != ICElement.C_ARCHIVE)) {
+ return new Status(IStatus.ERROR, LaunchUIPlugin.getUniqueIdentifier(), 1, LaunchUIPlugin.getResourceString("CMainTab.Selection_must_be_binary_file"), null); //$NON-NLS-1$
}
+
+ return new Status(IStatus.OK, LaunchUIPlugin.getUniqueIdentifier(), IStatus.OK, celement.getResource().getName(), null);
+ } catch(Exception ex) {
+ return new Status(IStatus.ERROR, LaunchUIPlugin.PLUGIN_ID, 1, LaunchUIPlugin.getResourceString("CMainTab.Selection_must_be_binary_file"), null); //$NON-NLS-1$
}
}
});
@@ -422,7 +419,6 @@ public class CMainTab extends CLaunchConfigurationTab {
protected ICProject[] getCProjects() throws CModelException {
ICProject cproject[] = CoreModel.getDefault().getCModel().getCProjects();
ArrayList list = new ArrayList(cproject.length);
- boolean isNative = filterPlatform.equals(Platform.getOS());
for (int i = 0; i < cproject.length; i++) {
ICDescriptor cdesciptor = null;
@@ -431,8 +427,7 @@ public class CMainTab extends CLaunchConfigurationTab {
String projectPlatform = cdesciptor.getPlatform();
if (filterPlatform.equals("*") //$NON-NLS-1$
|| projectPlatform.equals("*") //$NON-NLS-1$
- || (isNative && cdesciptor.getPlatform().equalsIgnoreCase(ICDebugConfiguration.PLATFORM_NATIVE))
- || filterPlatform.equalsIgnoreCase(cdesciptor.getPlatform()) == true) {
+ || filterPlatform.equalsIgnoreCase(projectPlatform) == true) {
list.add(cproject[i]);
}
} catch (CoreException e) {
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CorefileDebuggerTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CorefileDebuggerTab.java
index dea89139f50..b9e5ba893d3 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CorefileDebuggerTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CorefileDebuggerTab.java
@@ -109,7 +109,7 @@ public class CorefileDebuggerTab extends AbstractCDebuggerTab {
//The behaviour is undefined for if the callbacks should be triggered for this,
//so to avoid unnecessary confusion, we force an update.
handleDebuggerChanged();
- fDCombo.getParent().layout(true);
+ getControl().getParent().layout(true);
initializingComboBox = false;
}

Back to the top