Skip to main content
summaryrefslogtreecommitdiffstats
path: root/launch
diff options
context:
space:
mode:
authorPawel Piech2009-02-27 17:38:54 -0500
committerPawel Piech2009-02-27 17:38:54 -0500
commitb006bc98c3abca8ba53bd7c5132ccd0d883703c2 (patch)
tree6ac8e9d3a24676c0e58b157f0ebc6f3033377ad8 /launch
parent22b507266d6d249da439d6b8bb351df43be9fa4c (diff)
downloadorg.eclipse.cdt-b006bc98c3abca8ba53bd7c5132ccd0d883703c2.tar.gz
org.eclipse.cdt-b006bc98c3abca8ba53bd7c5132ccd0d883703c2.tar.xz
org.eclipse.cdt-b006bc98c3abca8ba53bd7c5132ccd0d883703c2.zip
Bug 262826 - Create common C/C++ launch configurations
Diffstat (limited to 'launch')
-rw-r--r--launch/org.eclipse.cdt.launch/plugin.properties20
-rw-r--r--launch/org.eclipse.cdt.launch/plugin.xml258
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java52
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java448
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CPropertyTester.java57
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java3
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalAttachLaunchDelegate.java4
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.properties17
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java7
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java4
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ApplicationCDebuggerTab.java22
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/AttachCDebuggerTab.java22
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CArgumentsTab.java17
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java14
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainAttachTab.java3
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java15
16 files changed, 275 insertions, 688 deletions
diff --git a/launch/org.eclipse.cdt.launch/plugin.properties b/launch/org.eclipse.cdt.launch/plugin.properties
index c81dd4f5d8..109d6740c1 100644
--- a/launch/org.eclipse.cdt.launch/plugin.properties
+++ b/launch/org.eclipse.cdt.launch/plugin.properties
@@ -11,11 +11,17 @@
pluginName=C/C++ Development Tools Launching Support
providerName=Eclipse.org
-LocalCDTLaunch.name=C/C++ Local Application
-LocalAttachCDTLaunch.name=C/C++ Attach to Local Application
-CoreFileCDTLaunch.name=C/C++ Postmortem debugger
-
-CApplicationShortcut.label=Local C/C++ Application
-ContextualRunCApplication.description=Runs a local C/C++ application
-ContextualDebugCApplication.description=Debugs a local C/C++ application
+LocalCDTLaunch.name=Standard Create Process
+LocalCDTLaunch.description=Start new application optionally under control of the standard debugger.
+LocalAttachCDTLaunch.name=Standard Attach to Process
+LocalAttachCDTLaunch.description=Attach standard debugger to a running program using.
+CoreFileCDTLaunch.name=Standard Postmortem Debugger
+CoreFileCDTLaunch.description=Load an application dump into the standard debugger.
+MainLaunchTab.name=Main
+ArgumentsLaunchTab.name=Arguments
+EnvironmentLaunchTab.name=Environment
+DebuggerLaunchTab.name=Debugger
+SourceLookupLaunchTab.name=Source
+CommonLaunchTab.name=Common
+CoreFileLaunchTab.name=Debugger \ No newline at end of file
diff --git a/launch/org.eclipse.cdt.launch/plugin.xml b/launch/org.eclipse.cdt.launch/plugin.xml
index 283833b730..717eeb6120 100644
--- a/launch/org.eclipse.cdt.launch/plugin.xml
+++ b/launch/org.eclipse.cdt.launch/plugin.xml
@@ -3,124 +3,155 @@
<plugin>
<extension
- point="org.eclipse.debug.core.launchConfigurationTypes">
- <launchConfigurationType
- sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
+ point="org.eclipse.debug.core.launchDelegates">
+ <launchDelegate
+ id="org.eclipse.cdt.cdi.launch.localCLaunch"
+ type="org.eclipse.cdt.launch.applicationLaunchType"
delegate="org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate"
- public="true"
- sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer"
+ modes="run,debug"
name="%LocalCDTLaunch.name"
- id="org.eclipse.cdt.launch.localCLaunch"
- modes="run,debug">
- </launchConfigurationType>
- <launchConfigurationType
+ delegateDescription="%LocalCDTLaunch.description"
+ sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
+ sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer">
+ </launchDelegate>
+ <launchDelegate
+ id="org.eclipse.cdt.cdi.launch.localCAttachLaunch"
+ type="org.eclipse.cdt.launch.attachLaunchType"
delegate="org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate"
- id="org.eclipse.cdt.launch.localAttachCLaunch"
modes="debug"
name="%LocalAttachCDTLaunch.name"
- public="true"
+ delegateDescription="%LocalAttachCDTLaunch.description"
sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer">
- </launchConfigurationType>
- <launchConfigurationType
+ </launchDelegate>
+ <launchDelegate
+ id="org.eclipse.cdt.cdi.launch.coreFileCLaunch"
+ type="org.eclipse.cdt.launch.postmortemLaunchType"
delegate="org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate"
- id="org.eclipse.cdt.launch.coreFileCLaunch"
modes="debug"
name="%CoreFileCDTLaunch.name"
- public="true"
+ delegateDescription="%CoreFileCDTLaunch.description"
sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer">
- </launchConfigurationType>
- </extension>
- <extension
- point="org.eclipse.debug.ui.launchConfigurationTypeImages">
- <launchConfigurationTypeImage
- icon="icons/obj16/c_app.gif"
- configTypeID="org.eclipse.cdt.launch.localCLaunch"
- id="org.eclipse.cdt.launch.localRunLaunchImage">
- </launchConfigurationTypeImage>
- <launchConfigurationTypeImage
- icon="icons/obj16/c_app.gif"
- configTypeID="org.eclipse.cdt.launch.localAttachCLaunch"
- id="org.eclipse.cdt.launch.localAttachLaunchImage">
- </launchConfigurationTypeImage>
- <launchConfigurationTypeImage
- icon="icons/obj16/c_app.gif"
- configTypeID="org.eclipse.cdt.launch.coreFileCLaunch"
- id="org.eclipse.cdt.launch.coreFileLaunchImage">
- </launchConfigurationTypeImage>
+ </launchDelegate>
</extension>
+
<extension
- point="org.eclipse.debug.ui.launchConfigurationTabGroups">
- <launchConfigurationTabGroup
- type="org.eclipse.cdt.launch.localCLaunch"
- class="org.eclipse.cdt.launch.internal.ui.LocalRunLaunchConfigurationTabGroup"
- id="org.eclipse.cdt.launch.localRunLaunchTabGroup">
- </launchConfigurationTabGroup>
- <launchConfigurationTabGroup
- type="org.eclipse.cdt.launch.localAttachCLaunch"
- class="org.eclipse.cdt.launch.internal.ui.LocalAttachLaunchConfigurationTabGroup"
- id="org.eclipse.cdt.launch.localAttachLaunchTabGroup">
- </launchConfigurationTabGroup>
- <launchConfigurationTabGroup
- type="org.eclipse.cdt.launch.coreFileCLaunch"
- class="org.eclipse.cdt.launch.internal.ui.CoreFileLaunchConfigurationTabGroup"
- id="org.eclipse.cdt.launch.coreFileCLaunchTabGroup">
- </launchConfigurationTabGroup>
- </extension>
- <extension
- point="org.eclipse.debug.ui.launchShortcuts">
- <shortcut
- label="%CApplicationShortcut.label"
- icon="icons/obj16/c_app.gif"
- modes="run, debug"
- class="org.eclipse.cdt.launch.internal.CApplicationLaunchShortcut"
- id="org.eclipse.cdt.debug.ui.localCShortcut">
- <contextualLaunch>
- <enablement>
- <with variable="selection">
- <count value="1"/>
- <iterate>
- <or>
- <instanceof value="org.eclipse.cdt.core.model.IBinary"/>
- <instanceof value="org.eclipse.cdt.core.model.ICProject"/>
- <test
- forcePluginActivation="true"
- property="org.eclipse.cdt.launch.isExecutable"/>
- <test
- forcePluginActivation="true"
- property="org.eclipse.cdt.launch.isCProject"/>
- <and>
- <instanceof value="org.eclipse.ui.IFileEditorInput"/>
- <adapt type="org.eclipse.core.resources.IResource">
- <adapt type="org.eclipse.cdt.core.model.ICElement"/>
- </adapt>
- </and>
- </or>
- </iterate>
- </with>
- </enablement>
- </contextualLaunch>
- <description
- mode="run"
- description="%ContextualRunCApplication.description"/>
- <description
- mode="debug"
- description="%ContextualDebugCApplication.description"/>
- <configurationType
- id="org.eclipse.cdt.launch.localCLaunch">
- </configurationType>
- </shortcut>
- </extension>
-<!-- Property testers -->
- <extension point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- namespace="org.eclipse.cdt.launch"
- properties="isExecutable,isCProject"
- type="org.eclipse.core.runtime.IAdaptable"
- class="org.eclipse.cdt.launch.internal.CPropertyTester"
- id="org.eclipse.cdt.launch.CPropertyTester">
- </propertyTester>
+ point="org.eclipse.debug.ui.launchConfigurationTabs">
+ <!-- Application launch tabs-->
+ <tab
+ id="org.eclipse.cdt.cdi.launch.applicationLaunch.mainTab"
+ group="org.eclipse.cdt.launch.applicationLaunchTabGroup"
+ name="%MainLaunchTab.name"
+ class="org.eclipse.cdt.launch.ui.CMainTab">
+ <associatedDelegate delegate="org.eclipse.cdt.cdi.launch.localCLaunch"/>
+ </tab>
+ <tab
+ id="org.eclipse.cdt.cdi.launch.applicationLaunch.argumentsTab"
+ group="org.eclipse.cdt.launch.applicationLaunchTabGroup"
+ name="%ArgumentsLaunchTab.name"
+ class="org.eclipse.cdt.launch.ui.CArgumentsTab">
+ <associatedDelegate delegate="org.eclipse.cdt.cdi.launch.localCLaunch"/>
+ <placement after="org.eclipse.cdt.cdi.launch.mainTab"/>
+ </tab>
+ <tab
+ id="org.eclipse.cdt.cdi.launch.applicationLaunch.environmentTab"
+ group="org.eclipse.cdt.launch.applicationLaunchTabGroup"
+ name="%EnvironmentLaunchTab.name"
+ class="org.eclipse.debug.ui.EnvironmentTab">
+ <associatedDelegate delegate="org.eclipse.cdt.cdi.launch.localCLaunch"/>
+ <placement after="org.eclipse.cdt.cdi.launch.argumentsTab"/>
+ </tab>
+ <tab
+ id="org.eclipse.cdt.cdi.launch.applicationLaunch.debuggerTab"
+ group="org.eclipse.cdt.launch.applicationLaunchTabGroup"
+ name="%DebuggerLaunchTab.name"
+ class="org.eclipse.cdt.launch.ui.ApplicationCDebuggerTab">
+ <associatedDelegate delegate="org.eclipse.cdt.cdi.launch.localCLaunch"/>
+ <placement after="org.eclipse.debug.ui.environmentTab"/>
+ </tab>
+ <tab
+ id="org.eclipse.cdt.cdi.launch.applicationLaunch.sourceLookupTab"
+ group="org.eclipse.cdt.launch.applicationLaunchTabGroup"
+ name="%SourceLookupLaunchTab.name"
+ class="org.eclipse.debug.ui.sourcelookup.SourceLookupTab">
+ <associatedDelegate delegate="org.eclipse.cdt.cdi.launch.localCLaunch"/>
+ <placement after="org.eclipse.cdt.cdi.launch.debuggerTab"/>
+ </tab>
+ <tab
+ id="org.eclipse.cdt.cdi.launch.applicationLaunch.commonTab"
+ group="org.eclipse.cdt.launch.applicationLaunchTabGroup"
+ name="%CommonLaunchTab.name"
+ class="org.eclipse.debug.ui.CommonTab">
+ <associatedDelegate delegate="org.eclipse.cdt.cdi.launch.localCLaunch"/>
+ <placement after="org.eclipse.debug.ui.sourceLookupTab"/>
+ </tab>
+
+ <!-- Attach launch tabs-->
+ <tab
+ id="org.eclipse.cdt.cdi.launch.attachLaunch.mainAttachTab"
+ group="org.eclipse.cdt.launch.attachLaunchTabGroup"
+ name="%MainLaunchTab.name"
+ class="org.eclipse.cdt.launch.ui.CMainAttachTab">
+ <associatedDelegate delegate="org.eclipse.cdt.cdi.launch.localCAttachLaunch"/>
+ </tab>
+ <tab
+ id="org.eclipse.cdt.cdi.launch.attachLaunch.debuggerTab"
+ group="org.eclipse.cdt.launch.attachLaunchTabGroup"
+ name="%DebuggerLaunchTab.name"
+ class="org.eclipse.cdt.launch.ui.AttachCDebuggerTab">
+ <associatedDelegate delegate="org.eclipse.cdt.cdi.launch.localCAttachLaunch"/>
+ <placement after="org.eclipse.cdt.cdi.launch.mainTab"/>
+ </tab>
+ <tab
+ id="org.eclipse.cdt.cdi.launch.attachLaunch.sourceLookupTab"
+ group="org.eclipse.cdt.launch.attachLaunchTabGroup"
+ name="%SourceLookupLaunchTab.name"
+ class="org.eclipse.debug.ui.sourcelookup.SourceLookupTab">
+ <associatedDelegate delegate="org.eclipse.cdt.cdi.launch.localCAttachLaunch"/>
+ <placement after="org.eclipse.cdt.cdi.launch.debuggerTab"/>
+ </tab>
+ <tab
+ id="org.eclipse.cdt.cdi.launch.attachLaunch.commonTab"
+ group="org.eclipse.cdt.launch.attachLaunchTabGroup"
+ name="%CommonLaunchTab.name"
+ class="org.eclipse.debug.ui.CommonTab">
+ <associatedDelegate delegate="org.eclipse.cdt.cdi.launch.localCAttachLaunch"/>
+ <placement after="org.eclipse.debug.ui.sourceLookupTab"/>
+ </tab>
+
+ <!-- Post mortem launch tabs-->
+ <tab
+ id="org.eclipse.cdt.cdi.launch.postmortemLaunch.mainTab"
+ group="org.eclipse.cdt.launch.postmortemLaunchTabGroup"
+ name="%MainLaunchTab.name"
+ class="org.eclipse.cdt.launch.ui.CMainTab">
+ <associatedDelegate delegate="org.eclipse.cdt.cdi.launch.coreFileCLaunch"/>
+ </tab>
+ <tab
+ id="org.eclipse.cdt.cdi.launch.postmortemLaunch.coreTab"
+ group="org.eclipse.cdt.launch.postmortemLaunchTabGroup"
+ name="%CoreFileLaunchTab.name"
+ class="org.eclipse.cdt.launch.ui.CoreFileDebuggerTab">
+ <associatedDelegate delegate="org.eclipse.cdt.cdi.launch.coreFileCLaunch"/>
+ <placement after="org.eclipse.cdt.cdi.launch.mainTab"/>
+ </tab>
+ <tab
+ id="org.eclipse.cdt.cdi.launch.postmortemLaunch.sourceLookupTab"
+ group="org.eclipse.cdt.launch.postmortemLaunchTabGroup"
+ name="%SourceLookupLaunchTab.name"
+ class="org.eclipse.debug.ui.sourcelookup.SourceLookupTab">
+ <associatedDelegate delegate="org.eclipse.cdt.cdi.launch.coreFileCLaunch"/>
+ <placement after="org.eclipse.cdt.cdi.launch.coreTab"/>
+ </tab>
+ <tab
+ id="org.eclipse.cdt.cdi.launch.postmortemLaunch.commonTab"
+ group="org.eclipse.cdt.launch.postmortemLaunchTabGroup"
+ name="%CommonLaunchTab.name"
+ class="org.eclipse.debug.ui.CommonTab">
+ <associatedDelegate delegate="org.eclipse.cdt.cdi.launch.coreFileCLaunch"/>
+ <placement after="org.eclipse.debug.ui.sourceLookupTab"/>
+ </tab>
</extension>
<extension
point="org.eclipse.debug.core.statusHandlers">
@@ -138,23 +169,4 @@
</statusHandler>
</extension>
- <!-- Adapters for contextual launch -->
- <extension point="org.eclipse.core.runtime.adapters">
- <factory
- class=""
- adaptableType="org.eclipse.cdt.core.model.IBinary">
- <adapter type="org.eclipse.debug.ui.actions.ILaunchable"/>
- </factory>
- <factory
- class=""
- adaptableType="org.eclipse.core.resources.IResource">
- <adapter type="org.eclipse.debug.ui.actions.ILaunchable"/>
- </factory>
- <factory
- class=""
- adaptableType="org.eclipse.cdt.core.model.ICProject">
- <adapter type="org.eclipse.debug.ui.actions.ILaunchable"/>
- </factory>
- </extension>
-
</plugin>
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 43e7508c9c..0aaf238ae6 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
@@ -38,6 +38,7 @@ import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
+import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.core.ICDebugConfiguration;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
@@ -173,35 +174,32 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
abstract protected String getPluginID();
+ /**
+ * @deprecated Use {@link org.eclipse.cdt.debug.core.CDebugUtils} instead.
+ */
public static ICProject getCProject(ILaunchConfiguration configuration) throws CoreException {
- String projectName = getProjectName(configuration);
- if (projectName != null) {
- projectName = projectName.trim();
- if (projectName.length() > 0) {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(project);
- if (cProject != null && cProject.exists()) {
- return cProject;
- }
- }
- }
- return null;
+ return CDebugUtils.getCProject(configuration);
}
+ /**
+ * @deprecated Use {@link org.eclipse.cdt.debug.core.CDebugUtils} instead.
+ */
public static String getProjectName(ILaunchConfiguration configuration) throws CoreException {
- return configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null);
+ return CDebugUtils.getProjectName(configuration);
}
+ /**
+ * @deprecated Use {@link org.eclipse.cdt.debug.core.CDebugUtils} instead.
+ */
public static String getProgramName(ILaunchConfiguration configuration) throws CoreException {
- return configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, (String)null);
+ return CDebugUtils.getProgramName(configuration);
}
+ /**
+ * @deprecated Use {@link org.eclipse.cdt.debug.core.CDebugUtils} instead.
+ */
public static IPath getProgramPath(ILaunchConfiguration configuration) throws CoreException {
- String path = getProgramName(configuration);
- if (path == null || path.trim().length() == 0) {
- return null;
- }
- return new Path(path);
+ return CDebugUtils.getProgramPath(configuration);
}
/**
@@ -233,7 +231,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
IPersistableSourceLocator sourceLocator;
String id = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, (String)null);
if (id == null) {
- ICProject cProject = getCProject(configuration);
+ ICProject cProject = CDebugUtils.getCProject(configuration);
if (cProject == null) {
abort(LaunchMessages.getString("Launch.common.Project_does_not_exist"), null, //$NON-NLS-1$
ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT);
@@ -330,7 +328,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
@Deprecated
protected IFile getProgramFile(ILaunchConfiguration config) throws CoreException {
ICProject cproject = verifyCProject(config);
- String fileName = getProgramName(config);
+ String fileName = CDebugUtils.getProgramName(config);
if (fileName == null) {
abort(LaunchMessages.getString("AbstractCLaunchDelegate.Program_file_not_specified"), null, //$NON-NLS-1$
ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROGRAM);
@@ -349,12 +347,12 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
}
protected ICProject verifyCProject(ILaunchConfiguration config) throws CoreException {
- String name = getProjectName(config);
+ String name = CDebugUtils.getProjectName(config);
if (name == null) {
abort(LaunchMessages.getString("AbstractCLaunchDelegate.C_Project_not_specified"), null, //$NON-NLS-1$
ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROJECT);
}
- ICProject cproject = getCProject(config);
+ ICProject cproject = CDebugUtils.getCProject(config);
if (cproject == null) {
IProject proj = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
if (!proj.exists()) {
@@ -373,7 +371,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
protected IPath verifyProgramPath(ILaunchConfiguration config) throws CoreException {
ICProject cproject = verifyCProject(config);
- IPath programPath = getProgramPath(config);
+ IPath programPath = CDebugUtils.getProgramPath(config);
if (programPath == null || programPath.isEmpty()) {
abort(LaunchMessages.getString("AbstractCLaunchDelegate.Program_file_not_specified"), null, //$NON-NLS-1$
ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROGRAM);
@@ -386,7 +384,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
// Try the old way, which is required to support linked resources.
IFile projFile = null;
try {
- projFile = project.getFile(getProgramPath(config));
+ projFile = project.getFile(CDebugUtils.getProgramPath(config));
}
catch (IllegalArgumentException exc) {} // thrown if relative path that resolves to a root file (e.g., "..\somefile")
if (projFile != null && projFile.exists()) {
@@ -426,7 +424,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
IPath path = getWorkingDirectoryPath(configuration);
if (path == null) {
// default working dir is the project if this config has a project
- ICProject cp = getCProject(configuration);
+ ICProject cp = CDebugUtils.getCProject(configuration);
if (cp != null) {
IProject p = cp.getProject();
return p.getLocation().toFile();
@@ -723,7 +721,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
// build project list
orderedProjects = null;
- ICProject cProject = getCProject(configuration);
+ ICProject cProject = CDebugUtils.getCProject(configuration);
if (cProject != null) {
project = cProject.getProject();
HashSet projectSet = new HashSet();
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
deleted file mode 100644
index 41ff47547d..0000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java
+++ /dev/null
@@ -1,448 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- * Ken Ryall (Nokia) - bug 178731
- *******************************************************************************/
-package org.eclipse.cdt.launch.internal;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.model.CModelException;
-import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.core.model.IBinary;
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
-import org.eclipse.cdt.core.settings.model.ICProjectDescription;
-import org.eclipse.cdt.debug.core.CDebugCorePlugin;
-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.debug.core.ICDebugConfiguration;
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.cdt.debug.ui.ICDebuggerPage;
-import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
-import org.eclipse.cdt.launch.internal.ui.LaunchMessages;
-import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
-import org.eclipse.cdt.ui.CElementLabelProvider;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.ILaunchShortcut;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-import org.eclipse.ui.dialogs.TwoPaneElementSelector;
-
-public class CApplicationLaunchShortcut implements ILaunchShortcut {
-
- public void launch(IEditorPart editor, String mode) {
- searchAndLaunch(new Object[] { editor.getEditorInput()}, mode);
- }
-
- public void launch(ISelection selection, String mode) {
- if (selection instanceof IStructuredSelection) {
- searchAndLaunch(((IStructuredSelection) selection).toArray(), mode);
- }
- }
-
- public void launch(IBinary bin, String mode) {
- ILaunchConfiguration config = findLaunchConfiguration(bin, mode);
- if (config != null) {
- DebugUITools.launch(config, mode);
- }
- }
-
- /**
- * Locate a configuration to relaunch for the given type. If one cannot be found, create one.
- *
- * @return a re-useable config or <code>null</code> if none
- */
- protected ILaunchConfiguration findLaunchConfiguration(IBinary bin, String mode) {
- ILaunchConfiguration configuration = null;
- ILaunchConfigurationType configType = getCLaunchConfigType();
- List candidateConfigs = Collections.EMPTY_LIST;
- try {
- ILaunchConfiguration[] configs = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(configType);
- candidateConfigs = new ArrayList(configs.length);
- for (int i = 0; i < configs.length; i++) {
- ILaunchConfiguration config = configs[i];
- IPath programPath = AbstractCLaunchDelegate.getProgramPath(config);
- String projectName = AbstractCLaunchDelegate.getProjectName(config);
- IPath name = bin.getResource().getProjectRelativePath();
- if (programPath != null && programPath.equals(name)) {
- if (projectName != null && projectName.equals(bin.getCProject().getProject().getName())) {
- candidateConfigs.add(config);
- }
- }
- }
- } catch (CoreException e) {
- LaunchUIPlugin.log(e);
- }
-
- // If there are no existing configs associated with the IBinary, create one.
- // If there is exactly one config associated with the IBinary, return it.
- // Otherwise, if there is more than one config associated with the IBinary, prompt the
- // user to choose one.
- int candidateCount = candidateConfigs.size();
- if (candidateCount < 1) {
- // Set the default debugger based on the active toolchain on the project (if possible)
- ICDebugConfiguration debugConfig = null;
- IProject project = bin.getResource().getProject();
- ICProjectDescription projDesc = CoreModel.getDefault().getProjectDescription(project);
- ICConfigurationDescription configDesc = projDesc.getActiveConfiguration();
- String configId = configDesc.getId();
- ICDebugConfiguration[] debugConfigs = CDebugCorePlugin.getDefault().getActiveDebugConfigurations();
- int matchLength = 0;
- for (int i = 0; i < debugConfigs.length; ++i) {
- ICDebugConfiguration dc = debugConfigs[i];
- String[] patterns = dc.getSupportedBuildConfigPatterns();
- if (patterns != null) {
- for (int j = 0; j < patterns.length; ++j) {
- if (patterns[j].length() > matchLength && configId.matches(patterns[j])) {
- debugConfig = dc;
- matchLength = patterns[j].length();
- }
- }
- }
- }
-
- if ( debugConfig == null ) {
- // Prompt the user if more then 1 debugger.
- String programCPU = bin.getCPU();
- String os = Platform.getOS();
- debugConfigs = CDebugCorePlugin.getDefault().getActiveDebugConfigurations();
- List debugList = new ArrayList(debugConfigs.length);
- for (int i = 0; i < debugConfigs.length; i++) {
- String platform = debugConfigs[i].getPlatform();
- 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]);
- if (debugConfigs.length == 1) {
- debugConfig = debugConfigs[0];
- } else if (debugConfigs.length > 1) {
- debugConfig = chooseDebugConfig(debugConfigs, mode);
- }
- }
-
- if (debugConfig != null) {
- configuration = createConfiguration(bin, debugConfig);
- }
- } else if (candidateCount == 1) {
- configuration = (ILaunchConfiguration) candidateConfigs.get(0);
- } else {
- // Prompt the user to choose a config. A null result means the user
- // cancelled the dialog, in which case this method returns null,
- // since cancelling the dialog should also cancel launching anything.
- configuration = chooseConfiguration(candidateConfigs, mode);
- }
- return configuration;
- }
-
- /**
- * Method createConfiguration.
- * @param bin
- * @return ILaunchConfiguration
- */
- private ILaunchConfiguration createConfiguration(IBinary bin, ICDebugConfiguration debugConfig) {
- ILaunchConfiguration config = null;
- try {
- String projectName = bin.getResource().getProjectRelativePath().toString();
- ILaunchConfigurationType configType = getCLaunchConfigType();
- ILaunchConfigurationWorkingCopy wc =
- configType.newInstance(null, getLaunchManager().generateUniqueLaunchConfigurationNameFrom(bin.getElementName()));
- wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, projectName);
- wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, bin.getCProject().getElementName());
- wc.setMappedResources(new IResource[] {bin.getResource(), bin.getResource().getProject()});
- wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null);
- wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, true);
- wc.setAttribute(
- ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
- ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN);
- wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, debugConfig.getID());
-
- ICProjectDescription projDes = CCorePlugin.getDefault().getProjectDescription(bin.getCProject().getProject());
- if (projDes != null)
- {
- String buildConfigID = projDes.getActiveConfiguration().getId();
- wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, buildConfigID);
- }
-
- // Load up the debugger page to set the defaults. There should probably be a separate
- // extension point for this.
- ICDebuggerPage page = CDebugUIPlugin.getDefault().getDebuggerPage(debugConfig.getID());
- page.setDefaults(wc);
-
- config = wc.doSave();
- } catch (CoreException ce) {
- LaunchUIPlugin.log(ce);
- }
- return config;
- }
-
- /**
- * Method getCLaunchConfigType.
- * @return ILaunchConfigurationType
- */
- protected ILaunchConfigurationType getCLaunchConfigType() {
- return getLaunchManager().getLaunchConfigurationType(ICDTLaunchConfigurationConstants.ID_LAUNCH_C_APP);
- }
-
- protected ILaunchManager getLaunchManager() {
- return DebugPlugin.getDefault().getLaunchManager();
- }
-
- /**
- * Convenience method to get the window that owns this action's Shell.
- */
- protected Shell getShell() {
- return LaunchUIPlugin.getActiveWorkbenchShell();
- }
-
- /**
- * Method chooseDebugConfig.
- * @param debugConfigs
- * @param mode
- * @return ICDebugConfiguration
- */
- private ICDebugConfiguration chooseDebugConfig(ICDebugConfiguration[] debugConfigs, String mode) {
- ILabelProvider provider = new LabelProvider() {
- /**
- * The <code>LabelProvider</code> implementation of this
- * <code>ILabelProvider</code> method returns the element's <code>toString</code>
- * string. Subclasses may override.
- */
- public String getText(Object element) {
- if (element == null) {
- return ""; //$NON-NLS-1$
- } else if (element instanceof ICDebugConfiguration) {
- return ((ICDebugConfiguration) element).getName();
- }
- return element.toString();
- }
- };
- ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), provider);
- dialog.setElements(debugConfigs);
- dialog.setTitle(getDebugConfigDialogTitleString(debugConfigs, mode));
- dialog.setMessage(getDebugConfigDialogMessageString(debugConfigs, mode));
- dialog.setMultipleSelection(false);
- int result = dialog.open();
- provider.dispose();
- if (result == Window.OK) {
- return (ICDebugConfiguration) dialog.getFirstResult();
- }
- return null;
- }
-
- protected String getDebugConfigDialogTitleString(ICDebugConfiguration [] configList, String mode) {
- return LaunchMessages.getString("CApplicationLaunchShortcut.LaunchDebugConfigSelection"); //$NON-NLS-1$
- }
-
- protected String getDebugConfigDialogMessageString(ICDebugConfiguration [] configList, String mode) {
- if (mode.equals(ILaunchManager.DEBUG_MODE)) {
- return LaunchMessages.getString("CApplicationLaunchShortcut.ChooseConfigToDebug"); //$NON-NLS-1$
- } else if (mode.equals(ILaunchManager.RUN_MODE)) {
- return LaunchMessages.getString("CApplicationLaunchShortcut.ChooseConfigToRun"); //$NON-NLS-1$
- }
- return LaunchMessages.getString("CApplicationLaunchShortcut.Invalid_launch_mode_1"); //$NON-NLS-1$
- }
-
-
- /**
- * Show a selection dialog that allows the user to choose one of the specified
- * launch configurations. Return the chosen config, or <code>null</code> if the
- * user cancelled the dialog.
- */
- protected ILaunchConfiguration chooseConfiguration(List configList, String mode) {
- IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
- ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
- dialog.setElements(configList.toArray());
- dialog.setTitle(getLaunchSelectionDialogTitleString(configList, mode));
- dialog.setMessage(getLaunchSelectionDialogMessageString(configList, mode));
- dialog.setMultipleSelection(false);
- int result = dialog.open();
- labelProvider.dispose();
- if (result == Window.OK) {
- return (ILaunchConfiguration) dialog.getFirstResult();
- }
- return null;
- }
-
- protected String getLaunchSelectionDialogTitleString(List configList, String mode) {
- return LaunchMessages.getString("CApplicationLaunchShortcut.LaunchConfigSelection"); //$NON-NLS-1$
- }
-
- protected String getLaunchSelectionDialogMessageString(List binList, String mode) {
- if (mode.equals(ILaunchManager.DEBUG_MODE)) {
- return LaunchMessages.getString("CApplicationLaunchShortcut.ChooseLaunchConfigToDebug"); //$NON-NLS-1$
- } else if (mode.equals(ILaunchManager.RUN_MODE)) {
- return LaunchMessages.getString("CApplicationLaunchShortcut.ChooseLaunchConfigToRun"); //$NON-NLS-1$
- }
- return LaunchMessages.getString("CApplicationLaunchShortcut.Invalid_launch_mode_2"); //$NON-NLS-1$
- }
-
- /**
- * Prompts the user to select a binary
- *
- * @return the selected binary or <code>null</code> if none.
- */
- protected IBinary chooseBinary(List binList, String mode) {
- ILabelProvider programLabelProvider = new CElementLabelProvider() {
- public String getText(Object element) {
- if (element instanceof IBinary) {
- IBinary bin = (IBinary)element;
- StringBuffer name = new StringBuffer();
- name.append(bin.getPath().lastSegment());
- return name.toString();
- }
- return super.getText(element);
- }
- };
-
- ILabelProvider qualifierLabelProvider = new CElementLabelProvider() {
- public String getText(Object element) {
- if (element instanceof IBinary) {
- IBinary bin = (IBinary)element;
- StringBuffer name = new StringBuffer();
- name.append(bin.getCPU() + (bin.isLittleEndian() ? "le" : "be")); //$NON-NLS-1$ //$NON-NLS-2$
- name.append(" - "); //$NON-NLS-1$
- name.append(bin.getPath().toString());
- return name.toString();
- }
- return super.getText(element);
- }
- };
-
- TwoPaneElementSelector dialog = new TwoPaneElementSelector(getShell(), programLabelProvider, qualifierLabelProvider);
- dialog.setElements(binList.toArray());
- dialog.setTitle(getBinarySelectionDialogTitleString(binList, mode));
- dialog.setMessage(getBinarySelectionDialogMessageString(binList, mode));
- dialog.setUpperListLabel(LaunchMessages.getString("Launch.common.BinariesColon")); //$NON-NLS-1$
- dialog.setLowerListLabel(LaunchMessages.getString("Launch.common.QualifierColon")); //$NON-NLS-1$
- dialog.setMultipleSelection(false);
- if (dialog.open() == Window.OK) {
- return (IBinary) dialog.getFirstResult();
- }
-
- return null;
- }
-
- protected String getBinarySelectionDialogTitleString(List binList, String mode) {
- return LaunchMessages.getString("CApplicationLaunchShortcut.CLocalApplication"); //$NON-NLS-1$
- }
-
- protected String getBinarySelectionDialogMessageString(List binList, String mode) {
- if (mode.equals(ILaunchManager.DEBUG_MODE)) {
- return LaunchMessages.getString("CApplicationLaunchShortcut.ChooseLocalAppToDebug"); //$NON-NLS-1$
- } else if (mode.equals(ILaunchManager.RUN_MODE)) {
- return LaunchMessages.getString("CApplicationLaunchShortcut.ChooseLocalAppToRun"); //$NON-NLS-1$
- }
- return LaunchMessages.getString("CApplicationLaunchShortcut.Invalid_launch_mode_3"); //$NON-NLS-1$
- }
-
- /**
- * Method searchAndLaunch.
- * @param objects
- * @param mode
- */
- private void searchAndLaunch(final Object[] elements, String mode) {
- if (elements != null && elements.length > 0) {
- IBinary bin = null;
- if (elements.length == 1 && elements[0] instanceof IBinary) {
- bin = (IBinary)elements[0];
- } else {
- final List results = new ArrayList();
- ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(IProgressMonitor pm) throws InterruptedException {
- int nElements = elements.length;
- pm.beginTask("Looking for executables", nElements); //$NON-NLS-1$
- try {
- IProgressMonitor sub = new SubProgressMonitor(pm, 1);
- for (int i = 0; i < nElements; i++) {
- if (elements[i] instanceof IAdaptable) {
- IResource r = (IResource) ((IAdaptable) elements[i]).getAdapter(IResource.class);
- if (r != null) {
- ICProject cproject = CoreModel.getDefault().create(r.getProject());
- if (cproject != null) {
- try {
- IBinary[] bins = cproject.getBinaryContainer().getBinaries();
-
- for (int j = 0; j < bins.length; j++) {
- if (bins[j].isExecutable()) {
- results.add(bins[j]);
- }
- }
- } catch (CModelException e) {
- }
- }
- }
- }
- if (pm.isCanceled()) {
- throw new InterruptedException();
- }
- sub.done();
- }
- } finally {
- pm.done();
- }
- }
- };
- try {
- dialog.run(true, true, runnable);
- } catch (InterruptedException e) {
- return;
- } catch (InvocationTargetException e) {
- MessageDialog.openError(getShell(), LaunchMessages.getString("CApplicationLaunchShortcut.Application_Launcher"), e.getMessage()); //$NON-NLS-1$
- return;
- }
- int count = results.size();
- if (count == 0) {
- MessageDialog.openError(getShell(), LaunchMessages.getString("CApplicationLaunchShortcut.Application_Launcher"), LaunchMessages.getString("CApplicationLaunchShortcut.Launch_failed_no_binaries")); //$NON-NLS-1$ //$NON-NLS-2$
- } else if (count > 1) {
- bin = chooseBinary(results, mode);
- } else {
- bin = (IBinary)results.get(0);
- }
- }
- if (bin != null) {
- launch(bin, mode);
- }
- } else {
- MessageDialog.openError(getShell(), LaunchMessages.getString("CApplicationLaunchShortcut.Application_Launcher"), LaunchMessages.getString("CApplicationLaunchShortcut.Launch_failed_no_project_selected")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
-}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CPropertyTester.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CPropertyTester.java
deleted file mode 100644
index e048fc2e56..0000000000
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CPropertyTester.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation
- * Ken Ryall (Nokia) - Modified to launch on a project context.
- *******************************************************************************/
-package org.eclipse.cdt.launch.internal;
-
-import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.core.model.IBinary;
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-
-/**
- * A property tester that determines if a file is an executable.
- */
-public class CPropertyTester extends PropertyTester {
-
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if ("isExecutable".equals(property)) //$NON-NLS-1$
- return isExecutable(receiver);
- else if ("isCProject".equals(property)) //$NON-NLS-1$
- return isCProject(receiver);
- else
- return false;
- }
-
- private boolean isExecutable(Object receiver) {
- ICElement celement = null;
- if (receiver instanceof IAdaptable) {
- IResource res = (IResource) ((IAdaptable)receiver).getAdapter(IResource.class);
- if (res != null) {
- celement = CoreModel.getDefault().create(res);
- }
- }
- return (celement != null && celement instanceof IBinary);
- }
-
- private boolean isCProject(Object receiver) {
- if (receiver instanceof IProject)
- return CoreModel.hasCNature((IProject)receiver);
- else if (receiver instanceof ICProject)
- return true;
- else
- return false;
- }
-
-}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java
index 8665ba8a95..6ea910f8d4 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java
@@ -16,6 +16,7 @@ import java.io.File;
import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.debug.core.CDIDebugModel;
+import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.core.ICDebugConfiguration;
import org.eclipse.cdt.debug.core.cdi.CDIException;
@@ -58,7 +59,7 @@ public class CoreFileLaunchDelegate extends AbstractCLaunchDelegate {
ICDebugConfiguration debugConfig = getDebugConfig(config);
ICDISession dsession = null;
- ICProject cproject = getCProject(config);
+ ICProject cproject = CDebugUtils.getCProject(config);
String path = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, (String)null);
if (path == null) {
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalAttachLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalAttachLaunchDelegate.java
index f520f41aa0..77d17eb969 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalAttachLaunchDelegate.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalAttachLaunchDelegate.java
@@ -11,9 +11,11 @@
package org.eclipse.cdt.launch.internal;
import java.io.FileNotFoundException;
+
import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.debug.core.CDIDebugModel;
+import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.core.ICDebugConfiguration;
import org.eclipse.cdt.debug.core.cdi.CDIException;
@@ -61,7 +63,7 @@ public class LocalAttachLaunchDelegate extends AbstractCLaunchDelegate {
try {
monitor.worked(1);
ICProject cproject = verifyCProject(config);
- IPath exePath = getProgramPath(config);
+ IPath exePath = CDebugUtils.getProgramPath(config);
if (exePath != null && !exePath.isEmpty()) {
if (!exePath.isAbsolute()) {
IFile wsProgramPath = cproject.getProject().getFile(exePath);
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.properties b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.properties
index d552f4373a..31f5e89b80 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.properties
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.properties
@@ -51,23 +51,6 @@ CoreFileLaunchDelegate.Corefile_not_accessible=Core file is not accessible.
CoreFileLaunchDelegate.Corefile_not_readable=Core file does not exist or is not readable.
CoreFileLaunchDelegate.postmortem_debugging_failed=Post-mortem debugging failed
-CApplicationLaunchShortcut.Application_Launcher=Application Launcher
-CApplicationLaunchShortcut.ChooseConfigToDebug=Choose a debug configuration to debug
-CApplicationLaunchShortcut.ChooseConfigToRun=Choose a configuration to run
-CApplicationLaunchShortcut.CLocalApplication=C Local Application
-CApplicationLaunchShortcut.ChooseLocalAppToDebug=Choose a local application to debug
-CApplicationLaunchShortcut.ChooseLocalAppToRun=Choose a local application to run
-CApplicationLaunchShortcut.Launch_failed_no_binaries=Launch failed. Binary not found.
-CApplicationLaunchShortcut.LaunchFailed=Launch failed
-CApplicationLaunchShortcut.LaunchDebugConfigSelection=Launch Debug Configuration Selection
-CApplicationLaunchShortcut.LaunchConfigSelection=Launch Configuration Selection
-CApplicationLaunchShortcut.Invalid_launch_mode_1=Invalid launch mode
-CApplicationLaunchShortcut.Invalid_launch_mode_2=Invalid launch mode.
-CApplicationLaunchShortcut.Invalid_launch_mode_3=Invalid launch mode.
-CApplicationLaunchShortcut.ChooseLaunchConfigToDebug=Choose a launch configuration to debug
-CApplicationLaunchShortcut.ChooseLaunchConfigToRun=Choose a launch configuration to run
-CApplicationLaunchShortcut.Launch_failed_no_project_selected=Launch failed no project selected
-
AbstractCDebuggerTab.No_debugger_available=No debugger available
AbstractCDebuggerTab.Debugger=Debugger
AbstractCDebuggerTab.ErrorLoadingDebuggerPage=Error Loading Debugger UI Component.
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 a439ce2682..2a18a84dd3 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
@@ -11,7 +11,9 @@
package org.eclipse.cdt.launch.internal.ui;
import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
+import org.eclipse.cdt.debug.core.CDebugCorePlugin;
+import org.eclipse.cdt.debug.core.CDebugUtils;
+import org.eclipse.cdt.debug.core.ICDebugConstants;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
@@ -185,6 +187,7 @@ public class LaunchUIPlugin extends AbstractUIPlugin implements IDebugEventSetLi
*/
public void start(BundleContext context) throws Exception {
super.start(context);
+ LaunchUIPlugin.getDefault().getPluginPreferences().getString( ICDebugConstants.PREF_FILTERED_DEBUGGERS );
DebugPlugin.getDefault().addDebugEventListener(this);
}
@@ -216,7 +219,7 @@ public class LaunchUIPlugin extends AbstractUIPlugin implements IDebugEventSetLi
try {
ILaunchConfiguration launchConfig = proc.getLaunch().getLaunchConfiguration();
if (launchConfig != null) {
- cproject = AbstractCLaunchDelegate.getCProject(launchConfig);
+ cproject = CDebugUtils.getCProject(launchConfig);
}
} catch (CoreException e) {
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java
index efa9542b6e..f46b2f4c69 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java
@@ -13,8 +13,8 @@ package org.eclipse.cdt.launch.internal.ui;
import java.io.File;
import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
import org.eclipse.cdt.launch.ui.CLaunchConfigurationTab;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
@@ -249,7 +249,7 @@ public class WorkingDirectoryBlock extends CLaunchConfigurationTab {
try {
ILaunchConfiguration config = getLaunchConfiguration();
if (config != null) {
- ICProject cProject = AbstractCLaunchDelegate.getCProject(config);
+ ICProject cProject = CDebugUtils.getCProject(config);
if (cProject != null) {
fWorkingDirText.setText("${workspace_loc:" + cProject.getPath().makeRelative().toOSString() + "}"); //$NON-NLS-1$ //$NON-NLS-2$
return;
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ApplicationCDebuggerTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ApplicationCDebuggerTab.java
new file mode 100644
index 0000000000..e5567beb20
--- /dev/null
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ApplicationCDebuggerTab.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Wind River Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.launch.ui;
+
+/**
+ * CDebugger tab to use for an application launch configuration.
+ *
+ * @since 6.0
+ */
+public class ApplicationCDebuggerTab extends CDebuggerTab {
+ public ApplicationCDebuggerTab() {
+ super (false);
+ }
+}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/AttachCDebuggerTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/AttachCDebuggerTab.java
new file mode 100644
index 0000000000..4454eb9b2e
--- /dev/null
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/AttachCDebuggerTab.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Wind River Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.launch.ui;
+
+/**
+ * CDebugger tab to use for an attach launch configuration.
+ *
+ * @since 6.0
+ */
+public class AttachCDebuggerTab extends CDebuggerTab {
+ public AttachCDebuggerTab() {
+ super (true);
+ }
+}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CArgumentsTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CArgumentsTab.java
index bb5d58b1e8..a1ce58aea8 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CArgumentsTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CArgumentsTab.java
@@ -49,7 +49,16 @@ import org.eclipse.swt.widgets.Text;
*/
public class CArgumentsTab extends CLaunchConfigurationTab {
- // Program arguments UI widgets
+ /**
+ * Tab identifier used for ordering of tabs added using the
+ * <code>org.eclipse.debug.ui.launchConfigurationTabs</code>
+ * extension point.
+ *
+ * @since 6.0
+ */
+ public static final String TAB_ID = "org.eclipse.cdt.cdi.launch.argumentsTab";
+
+ // Program arguments UI widgets
protected Label fPrgmArgumentsLabel;
protected Text fPrgmArgumentsText;
protected Button fArgumentVariablesButton;
@@ -218,6 +227,12 @@ public class CArgumentsTab extends CLaunchConfigurationTab {
return null;
}
+
+ @Override
+ public String getId() {
+ return TAB_ID;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
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 1b52ada19d..c447ddc1ff 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
@@ -65,6 +65,15 @@ import org.eclipse.swt.widgets.Text;
public class CDebuggerTab extends AbstractCDebuggerTab {
+ /**
+ * Tab identifier used for ordering of tabs added using the
+ * <code>org.eclipse.debug.ui.launchConfigurationTabs</code>
+ * extension point.
+ *
+ * @since 6.0
+ */
+ public static final String TAB_ID = "org.eclipse.cdt.cdi.launch.debuggerTab";
+
public class AdvancedDebuggerOptionsDialog extends Dialog {
private Button fVarBookKeeping;
@@ -154,6 +163,11 @@ public class CDebuggerTab extends AbstractCDebuggerTab {
}
}
+ @Override
+ public String getId() {
+ return TAB_ID;
+ }
+
public void createControl(Composite parent) {
fContainer = new ScrolledComposite( parent, SWT.V_SCROLL | SWT.H_SCROLL );
fContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainAttachTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainAttachTab.java
index 3ff3914c9a..c310ba0c08 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainAttachTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainAttachTab.java
@@ -14,7 +14,7 @@ import org.eclipse.debug.core.ILaunchConfiguration;
public class CMainAttachTab extends CMainTab {
-
+
public boolean isValid(ILaunchConfiguration config) {
if (super.isValid(config) == false) {
String name = fProgText.getText().trim();
@@ -26,5 +26,4 @@ public class CMainAttachTab extends CMainTab {
}
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 b9d80510b6..8e4c9dbb07 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
@@ -81,6 +81,15 @@ import org.eclipse.ui.dialogs.TwoPaneElementSelector;
public class CMainTab extends CLaunchConfigurationTab {
+ /**
+ * Tab identifier used for ordering of tabs added using the
+ * <code>org.eclipse.debug.ui.launchConfigurationTabs</code>
+ * extension point.
+ *
+ * @since 6.0
+ */
+ public static final String TAB_ID = "org.eclipse.cdt.cdi.launch.mainTab";
+
// Project UI widgets
protected Label fProjLabel;
protected Text fProjText;
@@ -780,6 +789,12 @@ public class CMainTab extends CLaunchConfigurationTab {
}
}
+ @Override
+ public String getId() {
+ return TAB_ID;
+ }
+
+
/*
* (non-Javadoc)
*

Back to the top