Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java')
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java26
1 files changed, 19 insertions, 7 deletions
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 66bb5f51a50..93a618d4155 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
@@ -35,6 +35,7 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchDelegate;
+import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -534,19 +535,30 @@ public class CMainTab extends CAbstractMainTab {
*/
public void setDefaults(ILaunchConfigurationWorkingCopy config) {
- // Workaround for bug 262840: select the standard CDT launcher by default.
- HashSet<String> set = new HashSet<String>();
- set.add(getLaunchConfigurationDialog().getMode());
+ // Workaround for bug 262840
try {
+ HashSet<String> set = new HashSet<String>();
+ set.add(ILaunchManager.DEBUG_MODE);
ILaunchDelegate preferredDelegate = config.getPreferredDelegate(set);
if (preferredDelegate == null) {
if (config.getType().getIdentifier().equals(ICDTLaunchConfigurationConstants.ID_LAUNCH_C_APP)) {
- config.setPreferredLaunchDelegate(set, "org.eclipse.cdt.dsf.gdb.launch.localCLaunch"); //$NON-NLS-1$
+ config.setPreferredLaunchDelegate(set, ICDTLaunchConfigurationConstants.PREFERRED_DEBUG_LOCAL_LAUNCH_DELEGATE);
} else if (config.getType().getIdentifier().equals(ICDTLaunchConfigurationConstants.ID_LAUNCH_C_ATTACH)) {
- config.setPreferredLaunchDelegate(set, "org.eclipse.cdt.dsf.gdb.launch.attachCLaunch"); //$NON-NLS-1$
+ config.setPreferredLaunchDelegate(set, ICDTLaunchConfigurationConstants.PREFERRED_DEBUG_ATTACH_LAUNCH_DELEGATE);
} else if (config.getType().getIdentifier().equals(ICDTLaunchConfigurationConstants.ID_LAUNCH_C_POST_MORTEM)) {
- config.setPreferredLaunchDelegate(set, "org.eclipse.cdt.dsf.gdb.launch.coreCLaunch"); //$NON-NLS-1$
- }
+ config.setPreferredLaunchDelegate(set, ICDTLaunchConfigurationConstants.PREFERRED_DEBUG_POSTMORTEM_LAUNCH_DELEGATE);
+ }
+ }
+ } catch (CoreException e) {}
+
+ // We must also set the preferred delegate for Run mode, because this configuration
+ // can be used in Run mode.
+ try {
+ HashSet<String> set = new HashSet<String>();
+ set.add(ILaunchManager.RUN_MODE);
+ ILaunchDelegate preferredDelegate = config.getPreferredDelegate(set);
+ if (preferredDelegate == null) {
+ config.setPreferredLaunchDelegate(set, ICDTLaunchConfigurationConstants.PREFERRED_RUN_LAUNCH_DELEGATE);
}
} catch (CoreException e) {}

Back to the top