From e8636fc09935458d4d904f0ce68f6e06a0d328d2 Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Sun, 16 Apr 2006 05:03:28 +0000 Subject: [PATCH] Bug 113107: Make trace logs more readily available. --- debug/org.eclipse.cdt.debug.mi.core/ChangeLog | 5 ++++ .../debug/mi/core/AbstractGDBCDIDebugger.java | 13 ++++++++ .../core/IMILaunchConfigurationConstants.java | 12 +++++++- debug/org.eclipse.cdt.debug.mi.ui/ChangeLog | 5 ++++ .../mi/internal/ui/MIUIMessages.properties | 1 + .../internal/ui/StandardGDBDebuggerPage.java | 30 ++++++++++++++++++- 6 files changed, 64 insertions(+), 2 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog index 641bc208772..b02333871ae 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog @@ -1,3 +1,8 @@ +2006-04-16 Mikhail Khodjaiants + Bug 113107: Make trace logs more readily available. + * AbstractGDBCDIDebugger.java + * IMILaunchConfigurationConstants.java + 2006-04-13 Mikhail Khodjaiants Bug 113107: Make trace logs more readily available. Core support for the "Verbose Mode" action. diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/AbstractGDBCDIDebugger.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/AbstractGDBCDIDebugger.java index c5318316041..5b414294b62 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/AbstractGDBCDIDebugger.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/AbstractGDBCDIDebugger.java @@ -62,6 +62,7 @@ abstract public class AbstractGDBCDIDebugger implements ICDIDebugger2 { if ( monitor.isCanceled() ) { throw new OperationCanceledException(); } + boolean verboseMode = verboseMode( launch.getLaunchConfiguration() ); Session session = createGDBSession( launch, executable, monitor ); if ( session != null ) { try { @@ -72,6 +73,7 @@ abstract public class AbstractGDBCDIDebugger implements ICDIDebugger2 { IProcess debuggerProcess = createGDBProcess( (Target)targets[i], launch, debugger, renderDebuggerProcessLabel( launch ), null ); launch.addProcess( debuggerProcess ); } + ((Target)targets[i]).enableVerboseMode( verboseMode ); ((Target)targets[i]).getMISession().start(); } doStartSession( launch, session, monitor ); @@ -197,4 +199,15 @@ abstract public class AbstractGDBCDIDebugger implements ICDIDebugger2 { protected IProcess createGDBProcess( Target target, ILaunch launch, Process process, String label, Map attributes ) { return new GDBProcess( target, launch, process, label, attributes ); } + + protected boolean verboseMode( ILaunchConfiguration config ) { + boolean result = IMILaunchConfigurationConstants.DEBUGGER_VERBOSE_MODE_DEFAULT; + try { + return config.getAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_VERBOSE_MODE, result ); + } + catch( CoreException e ) { + // use default + } + return result; + } } diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IMILaunchConfigurationConstants.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IMILaunchConfigurationConstants.java index 8316530d480..af37ae2883d 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IMILaunchConfigurationConstants.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IMILaunchConfigurationConstants.java @@ -69,8 +69,18 @@ public interface IMILaunchConfigurationConstants { public static final String ATTR_DEBUGGER_COMMAND_FACTORY = MIPlugin.getUniqueIdentifier() + ".commandFactory"; //$NON-NLS-1$ /** - * launch configuration attribute key. The value is a string specifying the protocol to + * 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 = MIPlugin.getUniqueIdentifier() + ".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 = MIPlugin.getUniqueIdentifier() + ".verboseMode"; //$NON-NLS-1$ + + /** + * Launch configuration attribute value. The key is ATTR_DEBUGGER_VERBOSE_MODE. + */ + public static final boolean DEBUGGER_VERBOSE_MODE_DEFAULT = false; } diff --git a/debug/org.eclipse.cdt.debug.mi.ui/ChangeLog b/debug/org.eclipse.cdt.debug.mi.ui/ChangeLog index 7a09e269a84..2456b33a9f4 100644 --- a/debug/org.eclipse.cdt.debug.mi.ui/ChangeLog +++ b/debug/org.eclipse.cdt.debug.mi.ui/ChangeLog @@ -1,3 +1,8 @@ +2006-04-16 Mikhail Khodjaiants + Bug 113107: Make trace logs more readily available. + * MIUIMessages.properties + * StandardGDBDebuggerPage.java + 2006-04-13 Mikhail Khodjaiants Bug 113107: Make trace logs more readily available. Implementation of the "Verbose Mode" action. diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MIUIMessages.properties b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MIUIMessages.properties index 1318e6503cc..f21f67ba062 100644 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MIUIMessages.properties +++ b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MIUIMessages.properties @@ -36,6 +36,7 @@ StandardGDBDebuggerPage.9=(Warning: Some commands in this file may interfere wit StandardGDBDebuggerPage.10=Shared Libraries StandardGDBDebuggerPage.11=Protocol: StandardGDBDebuggerPage.12=GDB command set: +StandardGDBDebuggerPage.13=Verbose console mode GDBServerDebuggerPage.0=TCP GDBServerDebuggerPage.1=Serial GDBServerDebuggerPage.10=Connection diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/StandardGDBDebuggerPage.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/StandardGDBDebuggerPage.java index daf2b501928..479597666d3 100644 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/StandardGDBDebuggerPage.java +++ b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/StandardGDBDebuggerPage.java @@ -60,6 +60,8 @@ public class StandardGDBDebuggerPage extends AbstractCDebuggerPage implements Ob protected Combo fProtocolCombo; + protected Button fVerboseModeButton; + private IMILaunchConfigurationComponent fSolibBlock; private CommandFactoryDescriptor[] fCommandFactoryDescriptors; @@ -81,6 +83,7 @@ public class StandardGDBDebuggerPage extends AbstractCDebuggerPage implements Ob configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, IMILaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT ); configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_GDB_INIT, IMILaunchConfigurationConstants.DEBUGGER_GDB_INIT_DEFAULT ); configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_COMMAND_FACTORY, MIPlugin.getDefault().getCommandFactoryManager().getDefaultDescriptor( getDebuggerIdentifier() ).getIdentifier() ); + configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_VERBOSE_MODE, IMILaunchConfigurationConstants.DEBUGGER_VERBOSE_MODE_DEFAULT ); if ( fSolibBlock != null ) fSolibBlock.setDefaults( configuration ); } @@ -157,7 +160,14 @@ public class StandardGDBDebuggerPage extends AbstractCDebuggerPage implements Ob } } fProtocolCombo.select( miIndex ); - + boolean verboseMode = IMILaunchConfigurationConstants.DEBUGGER_VERBOSE_MODE_DEFAULT; + try { + verboseMode = configuration.getAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_VERBOSE_MODE, IMILaunchConfigurationConstants.DEBUGGER_VERBOSE_MODE_DEFAULT ); + } + catch( CoreException e ) { + // use default + } + fVerboseModeButton.setSelection( verboseMode ); setInitializing( false ); } @@ -176,6 +186,7 @@ public class StandardGDBDebuggerPage extends AbstractCDebuggerPage implements Ob configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_PROTOCOL, str ); if ( fSolibBlock != null ) fSolibBlock.performApply( configuration ); + configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_VERBOSE_MODE, fVerboseModeButton.getSelection() ); } public String getName() { @@ -312,6 +323,7 @@ public class StandardGDBDebuggerPage extends AbstractCDebuggerPage implements Ob options.setLayoutData( gd ); createCommandFactoryCombo( options ); createProtocolCombo( options ); + createVerboseModeButton( subComp ); } public void createSolibTab( TabFolder tabFolder ) { @@ -399,4 +411,20 @@ public class StandardGDBDebuggerPage extends AbstractCDebuggerPage implements Ob } return ""; //$NON-NLS-1$ } + + protected void createVerboseModeButton( Composite parent ) { + fVerboseModeButton = createCheckButton( parent, MIUIMessages.getString( "StandardGDBDebuggerPage.13" ) ); //$NON-NLS-1$ + fVerboseModeButton.addSelectionListener( new SelectionListener() { + + public void widgetDefaultSelected( SelectionEvent e ) { + if ( !isInitializing() ) + updateLaunchConfigurationDialog(); + } + + public void widgetSelected( SelectionEvent e ) { + if ( !isInitializing() ) + updateLaunchConfigurationDialog(); + } + } ); + } }