diff --git a/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/launching/GDBSolibBlock.java b/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/launching/GDBSolibBlock.java index bc592a64dbe..7d90c50196d 100644 --- a/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/launching/GDBSolibBlock.java +++ b/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/launching/GDBSolibBlock.java @@ -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() { diff --git a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/FinalLaunchSequence.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/FinalLaunchSequence.java index 99edc8baeec..455c968c0a5 100644 --- a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/FinalLaunchSequence.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/FinalLaunchSequence.java @@ -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(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 */ diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetStopOnSolibEvents.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetStopOnSolibEvents.java new file mode 100644 index 00000000000..d3b8a89824d --- /dev/null +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetStopOnSolibEvents.java @@ -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$ + } +} \ No newline at end of file