Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jtag
diff options
context:
space:
mode:
authorMarc Khouzam2010-11-21 14:20:59 -0500
committerMarc Khouzam2010-11-21 14:20:59 -0500
commitc0a7a5724f92cf2cf974086ed5c0fdb0d8717596 (patch)
tree20e012bfec1f1ef9b8fee45b101856092ffbebd9 /jtag
parent8eb53df38141785283cb1590c33c9f85e95415ff (diff)
downloadorg.eclipse.cdt-c0a7a5724f92cf2cf974086ed5c0fdb0d8717596.tar.gz
org.eclipse.cdt-c0a7a5724f92cf2cf974086ed5c0fdb0d8717596.tar.xz
org.eclipse.cdt-c0a7a5724f92cf2cf974086ed5c0fdb0d8717596.zip
Bug 120162: [launch] Allow to specify the default version of gdb
Diffstat (limited to 'jtag')
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDSFDebuggerTab.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDSFDebuggerTab.java b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDSFDebuggerTab.java
index 036d984930..b32278f104 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDSFDebuggerTab.java
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDSFDebuggerTab.java
@@ -34,7 +34,9 @@ import org.eclipse.cdt.debug.mi.core.MIPlugin;
import org.eclipse.cdt.debug.mi.core.command.factories.CommandFactoryDescriptor;
import org.eclipse.cdt.debug.mi.core.command.factories.CommandFactoryManager;
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
+import org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
@@ -360,8 +362,9 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
public void initializeFrom(ILaunchConfiguration configuration) {
try {
- String gdbCommandAttr = configuration.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME,
- IMILaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT);
+ String defaultGdbCommand = Platform.getPreferencesService().getString("org.eclipse.cdt.dsf.gdb.ui", //$NON-NLS-1$
+ IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_COMMAND,"", null); //$NON-NLS-1$
+ String gdbCommandAttr = configuration.getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, defaultGdbCommand);
gdbCommand.setText(gdbCommandAttr);
boolean useRemoteAttr = configuration.getAttribute(IGDBJtagConstants.ATTR_USE_REMOTE_TARGET,
@@ -450,8 +453,10 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
}
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- configuration.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME,
- IMILaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT);
+ String defaultGdbCommand = Platform.getPreferencesService().getString("org.eclipse.cdt.dsf.gdb.ui", //$NON-NLS-1$
+ IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_COMMAND, "", null); //$NON-NLS-1$
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, defaultGdbCommand);
+
CommandFactoryManager cfManager = MIPlugin.getDefault().getCommandFactoryManager();
CommandFactoryDescriptor defDesc = cfManager.getDefaultDescriptor(IGDBJtagConstants.DEBUGGER_ID);
configuration.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_COMMAND_FACTORY, defDesc.getName());

Back to the top