1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-02 22:55:26 +02:00

[202353] Support for the launch to tell GDB to stop on library events (usually load/unload.)

This commit is contained in:
Marc Khouzam 2008-09-29 15:16:45 +00:00
parent d89fe5b50d
commit 98ff95d570
3 changed files with 49 additions and 1 deletions

View file

@ -111,7 +111,7 @@ public class GDBSolibBlock extends Observable implements IMILaunchConfigurationC
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 ) );
fUseSolibForAppButton.setSelection( configuration.getAttribute( IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP, IGDBLaunchConfigurationConstants.DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP_DEFAULT ) );
initializeButtons( configuration );
updateButtons();
}
@ -143,6 +143,7 @@ public class GDBSolibBlock extends Observable implements IMILaunchConfigurationC
fSolibSearchPathBlock.setDefaults( configuration );
configuration.setAttribute( IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, IGDBLaunchConfigurationConstants.DEBUGGER_AUTO_SOLIB_DEFAULT );
configuration.setAttribute( IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, IGDBLaunchConfigurationConstants.DEBUGGER_STOP_ON_SOLIB_EVENTS_DEFAULT );
configuration.setAttribute( IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP, IGDBLaunchConfigurationConstants.DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP_DEFAULT );
}
protected void updateButtons() {

View file

@ -54,6 +54,7 @@ import org.eclipse.dd.mi.service.command.commands.MIGDBSetAutoSolib;
import org.eclipse.dd.mi.service.command.commands.MIGDBSetBreakpointApply;
import org.eclipse.dd.mi.service.command.commands.MIGDBSetNonStop;
import org.eclipse.dd.mi.service.command.commands.MIGDBSetSolibSearchPath;
import org.eclipse.dd.mi.service.command.commands.MIGDBSetStopOnSolibEvents;
import org.eclipse.dd.mi.service.command.commands.MITargetSelect;
import org.eclipse.dd.mi.service.command.commands.RawCommand;
import org.eclipse.dd.mi.service.command.output.MIInfo;
@ -310,6 +311,22 @@ public class FinalLaunchSequence extends Sequence {
requestMonitor.done();
}
}},
/*
* Tell GDB to stop or not on shared library events
*/
new Step() { @Override
public void execute(RequestMonitor requestMonitor) {
try {
boolean stopOnSolibEvents = fLaunch.getLaunchConfiguration().getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS,
IGDBLaunchConfigurationConstants.DEBUGGER_STOP_ON_SOLIB_EVENTS_DEFAULT);
fCommandControl.queueCommand(
new MIGDBSetStopOnSolibEvents(fCommandControl.getContext(), stopOnSolibEvents),
new DataRequestMonitor<MIInfo>(getExecutor(), requestMonitor));
} catch (CoreException e) {
requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot set shared library option", e)); //$NON-NLS-1$
requestMonitor.done();
}
}},
/*
* Set the shared library paths
*/

View file

@ -0,0 +1,30 @@
/*******************************************************************************
* Copyright (c) 2008 QNX Software 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Ericsson - Initial API and implementation
*******************************************************************************/
package org.eclipse.dd.mi.service.command.commands;
import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext;
/**
*
* -gdb-set stop-on-solib-events
*
* Controls whether GDB should give you control when the dynamic linker
* notifies it about some shared library event. The most common event of interest is loading
* or unloading of a new shared library.
*
* @since 1.1
*/
public class MIGDBSetStopOnSolibEvents extends MIGDBSet
{
public MIGDBSetStopOnSolibEvents(ICommandControlDMContext ctx, boolean isSet) {
super(ctx, new String[] {"stop-on-solib-events", (isSet) ? "1" : "0"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}