Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Khouzam2010-05-14 01:50:46 +0000
committerMarc Khouzam2010-05-14 01:50:46 +0000
commitfe3c6d028fabd799ab3a83385ce2cf2001adbf97 (patch)
treefd9d51556cc3ba95e31777f4213918d6372d6968 /dsf-gdb
parentb3ddbdf187eea2ab8e4d1a9b9def176f742e977c (diff)
downloadorg.eclipse.cdt-fe3c6d028fabd799ab3a83385ce2cf2001adbf97.tar.gz
org.eclipse.cdt-fe3c6d028fabd799ab3a83385ce2cf2001adbf97.tar.xz
org.eclipse.cdt-fe3c6d028fabd799ab3a83385ce2cf2001adbf97.zip
Bug 281970: No longer show the Debugger, Refresh and Source tabs for a Run Configuration. Also, make sure a Run configuration can be used for Debug and vice versa.
Diffstat (limited to 'dsf-gdb')
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/LocalApplicationCDebuggerTab.java41
1 files changed, 40 insertions, 1 deletions
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
index 9e779f3747a..77d993dec4a 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems and others.
+ * Copyright (c) 2008, 2010 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
@@ -11,6 +11,9 @@
package org.eclipse.cdt.dsf.gdb.internal.ui.launching;
import org.eclipse.cdt.dsf.gdb.service.SessionType;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
/**
* Debugger tab to use for a local application launch configuration.
@@ -19,7 +22,43 @@ import org.eclipse.cdt.dsf.gdb.service.SessionType;
*/
public class LocalApplicationCDebuggerTab extends CDebuggerTab {
+ /*
+ * When the launch configuration is created for Run mode,
+ * this Debugger tab is not created because it is not used
+ * for Run mode but only for Debug mode.
+ * When we then open the same configuration in Debug mode, the launch
+ * configuration already exists and initializeFrom() is called
+ * instead of setDefaults().
+ * We therefore call setDefaults() ourselves and update the configuration.
+ * If we don't then the user will be required to press Apply to get the
+ * default settings saved.
+ * Bug 281970
+ */
+ private boolean fSetDefaultCalled;
+
public LocalApplicationCDebuggerTab() {
super(SessionType.LOCAL, false);
}
+
+ @Override
+ public void setDefaults(ILaunchConfigurationWorkingCopy config) {
+ fSetDefaultCalled = true;
+
+ super.setDefaults(config);
+ }
+
+ @Override
+ public void initializeFrom(ILaunchConfiguration config) {
+ if (fSetDefaultCalled == false) {
+ try {
+ ILaunchConfigurationWorkingCopy wc;
+ wc = config.getWorkingCopy();
+ setDefaults(wc);
+ wc.doSave();
+ } catch (CoreException e) {
+ }
+ }
+
+ super.initializeFrom(config);
+ }
}

Back to the top