1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 12:03:16 +02:00

Bug 244467 Add a checkbox to specify if the solib-search-path should

be used to debug processes; in such a case, we don't send the 'file' command.
This commit is contained in:
Marc Khouzam 2008-08-18 19:40:56 +00:00
parent d761fa884e
commit 69293447e9
4 changed files with 43 additions and 1 deletions

View file

@ -38,12 +38,16 @@ public class GDBSolibBlock extends Observable implements IMILaunchConfigurationC
private Button fAutoSoLibButton;
private Button fStopOnSolibEventsButton;
private Button fUseSolibForAppButton;
private Composite fControl;
private boolean fAutoSolib = false;
private boolean fStopOnSolibEvents = false;
private boolean fUseSolibForApp = true;
public GDBSolibBlock( IMILaunchConfigurationComponent solibSearchBlock, boolean autoSolib, boolean stopOnSolibEvents ) {
super();
@ -84,6 +88,17 @@ public class GDBSolibBlock extends Observable implements IMILaunchConfigurationC
}
} );
}
if ( fUseSolibForApp ) {
fUseSolibForAppButton = ControlFactory.createCheckBox( subComp, LaunchUIMessages.getString( "GDBSolibBlock.2" ) ); //$NON-NLS-1$
fUseSolibForAppButton.addSelectionListener( new SelectionAdapter() {
@Override
public void widgetSelected( SelectionEvent e ) {
updateButtons();
changed();
}
} );
}
fControl = subComp;
}
@ -95,6 +110,8 @@ public class GDBSolibBlock extends Observable implements IMILaunchConfigurationC
fAutoSoLibButton.setSelection( configuration.getAttribute( IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, IGDBLaunchConfigurationConstants.DEBUGGER_AUTO_SOLIB_DEFAULT ) );
if ( fStopOnSolibEventsButton != null )
fStopOnSolibEventsButton.setSelection( configuration.getAttribute( IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, IGDBLaunchConfigurationConstants.DEBUGGER_STOP_ON_SOLIB_EVENTS_DEFAULT ) );
if ( fUseSolibForAppButton != null )
fUseSolibForAppButton.setSelection( configuration.getAttribute( IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP, IGDBLaunchConfigurationConstants.DEBUGGER_STOP_ON_SOLIB_EVENTS_DEFAULT ) );
initializeButtons( configuration );
updateButtons();
}
@ -113,6 +130,8 @@ public class GDBSolibBlock extends Observable implements IMILaunchConfigurationC
attrs.put( IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, Boolean.valueOf( fAutoSoLibButton.getSelection() ) );
if ( fStopOnSolibEventsButton != null )
attrs.put( IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, Boolean.valueOf( fStopOnSolibEventsButton.getSelection() ) );
if ( fUseSolibForAppButton != null )
attrs.put( IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP, Boolean.valueOf( fUseSolibForAppButton.getSelection() ) );
configuration.setAttributes( attrs );
}
catch( CoreException e ) {
@ -154,6 +173,8 @@ public class GDBSolibBlock extends Observable implements IMILaunchConfigurationC
fAutoSoLibButton.setEnabled( enable );
if ( fStopOnSolibEventsButton != null )
fStopOnSolibEventsButton.setEnabled( enable );
if ( fUseSolibForAppButton != null )
fUseSolibForAppButton.setEnabled( enable );
}
catch( CoreException e ) {
}

View file

@ -53,6 +53,7 @@ GDBServerDebuggerPage.8=GDB Command File
GDBServerDebuggerPage.9=Type:
GDBSolibBlock.0=Load shared library symbols automatically
GDBSolibBlock.1=Stop on shared library events
GDBSolibBlock.2=Use shared library symbols for debugged applications
SerialPortSettingsBlock.0=Device:
SerialPortSettingsBlock.1=Speed:
SerialPortSettingsBlock.2=Device must be specified.

View file

@ -64,6 +64,11 @@ public class IGDBLaunchConfigurationConstants {
*/
public static final String ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS = GdbPlugin.PLUGIN_ID + ".STOP_ON_SOLIB_EVENTS"; //$NON-NLS-1$
/**
* Launch configuration attribute key. Boolean value to set the 'use shared library symbols for application' flag of the debugger.
*/
public static final String ATTR_DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP = GdbPlugin.PLUGIN_ID + ".USE_SOLIB_SYMBOLS_FOR_APP"; //$NON-NLS-1$
/**
* Launch configuration attribute key. The value is a List (array of String) of directories for the search path of shared libraries.
*/
@ -99,6 +104,11 @@ public class IGDBLaunchConfigurationConstants {
*/
public static final boolean DEBUGGER_STOP_ON_SOLIB_EVENTS_DEFAULT = false;
/**
* Launch configuration attribute value. The key is ATTR_DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP.
*/
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.
// */

View file

@ -118,8 +118,18 @@ public class FinalLaunchSequence extends Sequence {
*/
new Step() { @Override
public void execute(final RequestMonitor requestMonitor) {
boolean noFileCommand = IGDBLaunchConfigurationConstants.DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP_DEFAULT;
try {
noFileCommand = fLaunch.getLaunchConfiguration().getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP,
IGDBLaunchConfigurationConstants.DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP_DEFAULT);
} catch (CoreException e) {
requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot read use solib symbols for app options", e)); //$NON-NLS-1$
requestMonitor.done();
return;
}
final IPath execPath = fCommandControl.getExecutablePath();
if (execPath != null && !execPath.isEmpty()) {
if (!noFileCommand && execPath != null && !execPath.isEmpty()) {
fCommandControl.queueCommand(
new MIFileExecAndSymbols(fCommandControl.getControlDMContext(),
execPath.toOSString()),