diff --git a/debug/org.eclipse.cdt.debug.core/plugin.properties b/debug/org.eclipse.cdt.debug.core/plugin.properties index fe21739c3d8..3e41201a551 100644 --- a/debug/org.eclipse.cdt.debug.core/plugin.properties +++ b/debug/org.eclipse.cdt.debug.core/plugin.properties @@ -14,6 +14,10 @@ pluginName=C/C++ Development Tools Debug Model providerName=Eclipse.org +ApplicationLaunch.name=C/C++ Application +AttachLaunch.name=C/C++ Attach to Application +PostMortemLaunch.name=C/C++ Postmortem Debugger + CDebugger.name=C/C++ Development Tools Core Debugger Extension BreakpointAction.name=Breakpoint Action Extension diff --git a/debug/org.eclipse.cdt.debug.core/plugin.xml b/debug/org.eclipse.cdt.debug.core/plugin.xml index 932cbbf803b..158c37b6dd5 100644 --- a/debug/org.eclipse.cdt.debug.core/plugin.xml +++ b/debug/org.eclipse.cdt.debug.core/plugin.xml @@ -6,6 +6,25 @@ + + + + + + + + + diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java index 974f3293a61..4b088a477a5 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java @@ -28,6 +28,8 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; +import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.core.model.ICProject; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint; import org.eclipse.cdt.debug.core.model.ICBreakpoint; @@ -40,11 +42,13 @@ import org.eclipse.cdt.debug.core.model.ICWatchpoint2; import org.eclipse.cdt.debug.internal.core.model.CFloatingPointValue; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.IStatusHandler; import org.eclipse.debug.core.model.IBreakpoint; import org.w3c.dom.Document; @@ -511,4 +515,50 @@ public class CDebugUtils { return fDecoder; } + /** + * Note: Moved from AbstractCLaunchDelegate + * @since 6.0 + */ + 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; + } + + /** + * Note: Moved from AbstractCLaunchDelegate + * @since 6.0 + */ + public static String getProjectName(ILaunchConfiguration configuration) throws CoreException { + return configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null); + } + + /** + * Note: Moved from AbstractCLaunchDelegate + * @since 6.0 + */ + public static String getProgramName(ILaunchConfiguration configuration) throws CoreException { + return configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, (String)null); + } + + /** + * Note: Moved from AbstractCLaunchDelegate + * @since 6.0 + */ + 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); + } } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDTLaunchConfigurationConstants.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDTLaunchConfigurationConstants.java index c7b5de6b93b..f8dcf413863 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDTLaunchConfigurationConstants.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDTLaunchConfigurationConstants.java @@ -17,10 +17,24 @@ public interface ICDTLaunchConfigurationConstants { public static final String CDT_LAUNCH_ID = "org.eclipse.cdt.launch"; //$NON-NLS-1$ /** - * This is the launch type id. + * This is the application launch type id. */ - public static final String ID_LAUNCH_C_APP = "org.eclipse.cdt.launch.localCLaunch"; //$NON-NLS-1$ + public static final String ID_LAUNCH_C_APP = "org.eclipse.cdt.launch.applicationLaunchType"; //$NON-NLS-1$ + /** + * This is the attach launch type id. + * + * @since 6.0 + */ + public static final String ID_LAUNCH_C_ATTACH = "org.eclipse.cdt.launch.attachLaunchType"; //$NON-NLS-1$ + + /** + * This is the post-mortem launch type id. + * + * @since 6.0 + */ + public static final String ID_LAUNCH_C_POST_MORTEM = "org.eclipse.cdt.launch.postmortemLaunchType"; //$NON-NLS-1$ + /** * Identifier for the C/C++ program process type, which is annotated on processes created * by the C/C++ application launch delegate. diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.properties b/debug/org.eclipse.cdt.debug.ui/plugin.properties index 3ab258552cf..b8c407ca6b4 100644 --- a/debug/org.eclipse.cdt.debug.ui/plugin.properties +++ b/debug/org.eclipse.cdt.debug.ui/plugin.properties @@ -189,3 +189,9 @@ breapointType.regular.label=Regular breapointType.hardware.label=Hardware breapointType.temporay.label=Temporary breapointType.hardwaretemporaty.label=Hardware Temporary + +CApplicationShortcut.label=Local C/C++ Application +ContextualRunCApplication.description=Runs a local C/C++ application +ContextualDebugCApplication.description=Debugs a local C/C++ application + + diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.xml b/debug/org.eclipse.cdt.debug.ui/plugin.xml index 052cac7cf15..f7e3a7eb235 100644 --- a/debug/org.eclipse.cdt.debug.ui/plugin.xml +++ b/debug/org.eclipse.cdt.debug.ui/plugin.xml @@ -7,6 +7,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - org.eclipse.debug.ui.launchConfigurationTabs + * extension point. + * + * @since 2.0 + */ + public static final String TAB_ID = "org.eclipse.cdt.dsf.gdb.launch.argumentsTab"; + // Program arguments UI widgets protected Label fPrgmArgumentsLabel; protected Text fPrgmArgumentsText; @@ -222,6 +231,11 @@ 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/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CDebuggerTab.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CDebuggerTab.java index 7660e19b6d7..990f091a2d8 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CDebuggerTab.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CDebuggerTab.java @@ -61,6 +61,15 @@ import org.eclipse.swt.widgets.Text; public class CDebuggerTab extends AbstractCDebuggerTab { + /** + * Tab identifier used for ordering of tabs added using the + * org.eclipse.debug.ui.launchConfigurationTabs + * extension point. + * + * @since 2.0 + */ + public static final String TAB_ID = "org.eclipse.cdt.dsf.gdb.launch.debuggerTab"; + private final static String LOCAL_DEBUGGER_ID = "org.eclipse.cdt.dsf.gdb.GdbDebugger";//$NON-NLS-1$ private final static String REMOTE_DEBUGGER_ID = "org.eclipse.cdt.dsf.gdb.GdbServerDebugger";//$NON-NLS-1$ @@ -85,6 +94,11 @@ public class CDebuggerTab extends AbstractCDebuggerTab { } } + @Override + public String getId() { + return TAB_ID; + } + @Override public void createControl(Composite parent) { fContainer = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CMainAttachTab.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CMainAttachTab.java new file mode 100644 index 00000000000..8bb19250a28 --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CMainAttachTab.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * 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.dsf.gdb.internal.ui.launching; + + +/** + * Main tab to use for an attach launch configuration. + * + * @since 2.0 + */ +public class CMainAttachTab extends CMainTab { + public CMainAttachTab() { + super(2);// In some case, we don't need to specify an executable + } +} 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 8178ab08caa..36bab989daa 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 @@ -71,6 +71,15 @@ import org.eclipse.ui.dialogs.TwoPaneElementSelector; public class CMainTab extends CLaunchConfigurationTab { + /** + * Tab identifier used for ordering of tabs added using the + * org.eclipse.debug.ui.launchConfigurationTabs + * extension point. + * + * @since 2.0 + */ + public static final String TAB_ID = "org.eclipse.cdt.dsf.gdb.launch.mainTab"; + // Project UI widgets protected Label fProjLabel; protected Text fProjText; @@ -697,6 +706,11 @@ public class CMainTab extends CLaunchConfigurationTab { } } + @Override + public String getId() { + return TAB_ID; + } + /* * (non-Javadoc) * diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/LocalApplicationCDebuggerTab.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/LocalApplicationCDebuggerTab.java new file mode 100644 index 00000000000..9e779f3747a --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/LocalApplicationCDebuggerTab.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * 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.dsf.gdb.internal.ui.launching; + +import org.eclipse.cdt.dsf.gdb.service.SessionType; + +/** + * Debugger tab to use for a local application launch configuration. + * + * @since 2.0 + */ +public class LocalApplicationCDebuggerTab extends CDebuggerTab { + + public LocalApplicationCDebuggerTab() { + super(SessionType.LOCAL, false); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/RemoteApplicationCDebuggerTab.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/RemoteApplicationCDebuggerTab.java new file mode 100644 index 00000000000..570498c1208 --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/RemoteApplicationCDebuggerTab.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * 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.dsf.gdb.internal.ui.launching; + +import org.eclipse.cdt.dsf.gdb.service.SessionType; + +/** + * Debugger tab to use for a remote application launch configuration. + * + * @since 2.0 + */ +public class RemoteApplicationCDebuggerTab extends CDebuggerTab { + + public RemoteApplicationCDebuggerTab() { + super(SessionType.REMOTE, false); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/plugin.properties b/dsf-gdb/org.eclipse.cdt.dsf.gdb/plugin.properties index c3f20315fe2..08342fdd495 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/plugin.properties +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/plugin.properties @@ -11,3 +11,9 @@ pluginName=GDB DSF Debugger Integration Core providerName=Eclipse.org +launchDelegate.localApplication.name=GDB (DSF) Create Process +launchDelegate.localApplication.description=Start new application under control of GDB debugger integrated using the Debugger Services Framework (DSF). +launchDelegate.remoteApplication.name=GDB (DSF) Remote System Process +launchDelegate.remoteApplication.description=Start new application on a remote system under control of GDB debugger integrated using the Debugger Services Framework (DSF) +launchDelegate.attach.name=GDB (DSF) Attach to Process +launchDelegate.attach.description=Attach the GDB debugger, integrated using the Debugger Services Framework (DSF), to a running program. diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/plugin.xml b/dsf-gdb/org.eclipse.cdt.dsf.gdb/plugin.xml index c49c90e1fb3..5d6300f5df3 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/plugin.xml +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/plugin.xml @@ -2,34 +2,38 @@ - - + + - - + + - - - + + + - + - - + + - - + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + point="org.eclipse.debug.ui.launchConfigurationTabs"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -138,23 +169,4 @@ - - - - - - - - - - - - - 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 43e7508c9cf..0aaf238ae62 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/CoreFileLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java index 8665ba8a951..6ea910f8d43 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 f520f41aa04..77d17eb9692 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 d552f4373a5..31f5e89b809 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 a439ce26822..2a18a84dd3a 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 efa9542b6ed..f46b2f4c693 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 00000000000..e5567beb20d --- /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 00000000000..4454eb9b2ea --- /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 bb5d58b1e88..a1ce58aea87 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 + * org.eclipse.debug.ui.launchConfigurationTabs + * 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 1b52ada19db..c447ddc1ffd 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 + * org.eclipse.debug.ui.launchConfigurationTabs + * 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 3ff3914c9a6..c310ba0c088 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 b9d80510b63..8e4c9dbb07c 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 + * org.eclipse.debug.ui.launchConfigurationTabs + * 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) *