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 8cc819ac349..ae475ee6821 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 @@ -47,6 +47,7 @@ import org.eclipse.dd.mi.service.command.commands.MIEnvironmentCD; import org.eclipse.dd.mi.service.command.commands.MIFileExecAndSymbols; import org.eclipse.dd.mi.service.command.commands.MIGDBSetArgs; 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.MITargetSelect; @@ -211,6 +212,22 @@ public class FinalLaunchSequence extends Sequence { requestMonitor.done(); } }}, + /* + * Tell GDB to have breakpoint affect all processes being debugged. + * The user should actually make this decision. See bug 244053 + */ + new Step() { @Override + public void execute(final RequestMonitor requestMonitor) { + fCommandControl.queueCommand( + // This command will fail for GDBs without multi-process support, and that is ok + new MIGDBSetBreakpointApply(fCommandControl.getControlDMContext(), true), + new DataRequestMonitor(getExecutor(), requestMonitor) { + @Override + protected void handleCompleted() { + requestMonitor.done(); + } + }); + }}, /* * Enable non-stop mode if necessary */ diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetBreakpointApply.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetBreakpointApply.java new file mode 100644 index 00000000000..9570a24f881 --- /dev/null +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetBreakpointApply.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2008 Ericsson 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.mi.service.command.MIControlDMContext; + +/** + * + * -gdb-set breakpoint apply [global | process] + * + * Set breakpoints applicability mode. + * global == a breakpoint applies to all processes. + * process == a breakpoint applies to a single process. + */ +public class MIGDBSetBreakpointApply extends MIGDBSet +{ + public MIGDBSetBreakpointApply(MIControlDMContext ctx, boolean global) { + super(ctx, new String[] {"breakpoint", "apply", global ? "global" : "process"});//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$ + } +} +