From 405b19f8df79f3cc7717350ac5238e93ab8d3193 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Mon, 6 Oct 2008 18:53:15 +0000 Subject: [PATCH] [249227] we are not quite ready with the "verbose console feature", but since I had the changes needed to add the option in the launch, I figure I'd commit them. Once we have the feature ready, we'll just have to hook them to the launch option. --- .../ui/launching/GdbDebuggerPage.java | 37 +++++++++++++++++ .../IGDBLaunchConfigurationConstants.java | 40 +++++-------------- .../provisional/launching/LaunchUtils.java | 12 +++++- 3 files changed, 59 insertions(+), 30 deletions(-) diff --git a/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/launching/GdbDebuggerPage.java b/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/launching/GdbDebuggerPage.java index 1fb79a0717c..9b7f984a7fc 100644 --- a/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/launching/GdbDebuggerPage.java +++ b/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/launching/GdbDebuggerPage.java @@ -46,6 +46,8 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer { protected Text fGDBCommandText; protected Text fGDBInitText; protected Button fNonStopCheckBox; + protected Button fVerboseModeButton; + private IMILaunchConfigurationComponent fSolibBlock; private boolean fIsInitializing = false; @@ -67,6 +69,8 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer { IGDBLaunchConfigurationConstants.DEBUGGER_GDB_INIT_DEFAULT); configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP, IGDBLaunchConfigurationConstants.DEBUGGER_NON_STOP_DEFAULT); + configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_VERBOSE_MODE, + IGDBLaunchConfigurationConstants.DEBUGGER_VERBOSE_MODE_DEFAULT); if (fSolibBlock != null) fSolibBlock.setDefaults(configuration); @@ -91,6 +95,7 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer { String gdbCommand = IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT; String gdbInit = IGDBLaunchConfigurationConstants.DEBUGGER_GDB_INIT_DEFAULT; boolean nonStopMode = IGDBLaunchConfigurationConstants.DEBUGGER_NON_STOP_DEFAULT; + boolean verboseMode = IGDBLaunchConfigurationConstants.DEBUGGER_VERBOSE_MODE_DEFAULT; try { gdbCommand = configuration.getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, @@ -111,12 +116,19 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer { } catch(CoreException e) { } + try { + verboseMode = configuration.getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_VERBOSE_MODE, + IGDBLaunchConfigurationConstants.DEBUGGER_VERBOSE_MODE_DEFAULT ); + } + catch(CoreException e) { + } if (fSolibBlock != null) fSolibBlock.initializeFrom(configuration); fGDBCommandText.setText(gdbCommand); fGDBInitText.setText(gdbInit); fNonStopCheckBox.setSelection(nonStopMode); + fVerboseModeButton.setSelection(verboseMode); setInitializing(false); } @@ -128,6 +140,8 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer { fGDBInitText.getText().trim()); configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP, fNonStopCheckBox.getSelection()); + configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_VERBOSE_MODE, + fVerboseModeButton.getSelection() ); if (fSolibBlock != null) fSolibBlock.performApply(configuration); @@ -276,6 +290,29 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer { updateLaunchConfigurationDialog(); } }); + + fVerboseModeButton = ControlFactory.createCheckBox( subComp, LaunchUIMessages.getString( "StandardGDBDebuggerPage.13" ) ); //$NON-NLS-1$ + fVerboseModeButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetDefaultSelected(SelectionEvent e) { + if (!isInitializing()) + updateLaunchConfigurationDialog(); + } + + @Override + public void widgetSelected(SelectionEvent e) { + if (!isInitializing()) + updateLaunchConfigurationDialog(); + } + }); + + // fit options one per line + gd = new GridData(); + gd.horizontalSpan = 3; + fNonStopCheckBox.setLayoutData(gd); + gd = new GridData(); + gd.horizontalSpan = 3; + fVerboseModeButton.setLayoutData(gd); } public void createSolibTab(TabFolder tabFolder) { diff --git a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/IGDBLaunchConfigurationConstants.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/IGDBLaunchConfigurationConstants.java index c43f32bbc74..a38bef4e6ed 100644 --- a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/IGDBLaunchConfigurationConstants.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/IGDBLaunchConfigurationConstants.java @@ -76,6 +76,12 @@ public class IGDBLaunchConfigurationConstants { */ public static final String ATTR_DEBUGGER_AUTO_SOLIB_LIST = GdbPlugin.PLUGIN_ID + ".AUTO_SOLIB_LIST"; //$NON-NLS-1$ + /** + * Launch configuration attribute key. The value is a boolean specifying the mode of the gdb console. + * @since 1.1 + */ + public static final String ATTR_DEBUGGER_VERBOSE_MODE = GdbPlugin.PLUGIN_ID + ".verboseMode"; //$NON-NLS-1$ + /** * Launch configuration attribute value. The key is ATTR_DEBUG_NAME. */ @@ -103,33 +109,9 @@ public class IGDBLaunchConfigurationConstants { */ public static final boolean DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP_DEFAULT = false; -// /** -// * Launch configuration attribute key. The value is a string specifying the identifier of the command factory to use. -// */ -// public static final String ATTR_DEBUGGER_COMMAND_FACTORY = GdbPlugin.PLUGIN_ID + ".commandFactory"; //$NON-NLS-1$ -// -// /** -// * Launch configuration attribute key. The value is a string specifying the protocol to -// * use. For now only "mi", "mi1", "m2", "mi3" are supported. -// */ -// public static final String ATTR_DEBUGGER_PROTOCOL = GdbPlugin.PLUGIN_ID + ".protocol"; //$NON-NLS-1$ -// -// /** -// * Launch configuration attribute key. The value is a boolean specifying the mode of the gdb console. -// */ -// public static final String ATTR_DEBUGGER_VERBOSE_MODE = GdbPlugin.PLUGIN_ID + ".verboseMode"; //$NON-NLS-1$ -// -// /** -// * Launch configuration attribute value. The key is ATTR_DEBUGGER_VERBOSE_MODE. -// */ -// public static final boolean DEBUGGER_VERBOSE_MODE_DEFAULT = false; -// /** -// * Launch configuration attribute key. The value is a boolean specifying is debugger should use full pathname to set breakpoints. -// */ -// public static final String ATTR_DEBUGGER_FULLPATH_BREAKPOINTS = GdbPlugin.PLUGIN_ID + ".breakpointsFullPath"; //$NON-NLS-1$ -// -// /** -// * Launch configuration default attribute value. The key is ATTR_DEBUGGER_FULLPATH_BREAKPOINTS. -// */ -// public static final boolean DEBUGGER_FULLPATH_BREAKPOINTS_DEFAULT = false; + /** + * Launch configuration attribute value. The key is ATTR_DEBUGGER_VERBOSE_MODE. + * @since 1.1 + */ + public static final boolean DEBUGGER_VERBOSE_MODE_DEFAULT = false; } diff --git a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/LaunchUtils.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/LaunchUtils.java index 4be75fda410..f95fd771d6f 100644 --- a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/LaunchUtils.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/LaunchUtils.java @@ -273,6 +273,16 @@ public class LaunchUtils { } return SessionType.LOCAL; } - + + public static boolean getConsoleVerboseMode(ILaunchConfiguration config) { + boolean verboseMode = IGDBLaunchConfigurationConstants.DEBUGGER_VERBOSE_MODE_DEFAULT; + try { + verboseMode = config.getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_VERBOSE_MODE, + IGDBLaunchConfigurationConstants.DEBUGGER_VERBOSE_MODE_DEFAULT); + } catch (CoreException e) { + } + return verboseMode; + } + }