diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java index 7c340a6326c..6393a6edbf2 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java @@ -32,6 +32,7 @@ import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMContext; import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService; import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlShutdownDMEvent; import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; +import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext; import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext; import org.eclipse.cdt.dsf.mi.service.IMIProcesses; import org.eclipse.cdt.dsf.mi.service.IMIRunControl; @@ -350,7 +351,7 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService implements IMIRunCo } // Container case - IContainerDMContext container = DMContexts.getAncestorOfType(context, IContainerDMContext.class); + IMIContainerDMContext container = DMContexts.getAncestorOfType(context, IMIContainerDMContext.class); if (container != null) { doSuspendContainer(container, rm); return; @@ -374,8 +375,9 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService implements IMIRunCo fConnection.queueCommand(cmd, new DataRequestMonitor(getExecutor(), rm)); } - private void doSuspendContainer(IContainerDMContext context, final RequestMonitor rm) { - MIExecInterrupt cmd = new MIExecInterrupt(context, true); + private void doSuspendContainer(IMIContainerDMContext context, final RequestMonitor rm) { + String groupId = context.getGroupId(); + MIExecInterrupt cmd = new MIExecInterrupt(context, groupId); fConnection.queueCommand(cmd, new DataRequestMonitor(getExecutor(), rm)); } @@ -427,7 +429,7 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService implements IMIRunCo } // Container case - IContainerDMContext container = DMContexts.getAncestorOfType(context, IContainerDMContext.class); + IMIContainerDMContext container = DMContexts.getAncestorOfType(context, IMIContainerDMContext.class); if (container != null) { doResumeContainer(container, rm); return; @@ -466,8 +468,9 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService implements IMIRunCo }); } - private void doResumeContainer(IContainerDMContext context, final RequestMonitor rm) { - MIExecContinue cmd = new MIExecContinue(context, true); + private void doResumeContainer(IMIContainerDMContext context, final RequestMonitor rm) { + String groupId = context.getGroupId(); + MIExecContinue cmd = new MIExecContinue(context, groupId); fConnection.queueCommand(cmd, new DataRequestMonitor(getExecutor(), rm)); } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIExecContinue.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIExecContinue.java index 057a1553897..38ad3f67c19 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIExecContinue.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIExecContinue.java @@ -17,7 +17,7 @@ import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; /** * - * -exec-continue [--all] + * -exec-continue [--all | --thread-group ID] * * Asynchronous command. Resumes the execution of the inferior program * until a breakpoint is encountered, or until the inferior exits. @@ -33,9 +33,27 @@ public class MIExecContinue extends MICommand * @since 1.1 */ public MIExecContinue(IExecutionDMContext dmc, boolean allThreads) { + this(dmc, allThreads, null); + } + + /** + * @since 2.0 + */ + public MIExecContinue(IExecutionDMContext dmc, String groupId) { + this(dmc, false, groupId); + } + + /* + * The parameters allThreads and groupId are mutually exclusive. allThreads must be false + * if we are to use groupId. The value of this method is to only have one place + * where we use the hard-coded strings. + */ + private MIExecContinue(IExecutionDMContext dmc, boolean allThreads, String groupId) { super(dmc, "-exec-continue"); //$NON-NLS-1$ if (allThreads) { setParameters(new String[] { "--all" }); //$NON-NLS-1$ + } else if (groupId != null) { + setParameters(new String[] { "--thread-group", groupId }); //$NON-NLS-1$ } } } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIExecInterrupt.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIExecInterrupt.java index 4ca8a25224f..68db1d3d75f 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIExecInterrupt.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIExecInterrupt.java @@ -18,7 +18,7 @@ import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; /** * - * -exec-interrupt [--all] + * -exec-interrupt [--all | --thread-group ID] * * Asynchronous command. Interrupts the background execution of the * target. Note how the token associated with the stop message is the one @@ -38,9 +38,27 @@ public class MIExecInterrupt extends MICommand * @since 1.1 */ public MIExecInterrupt(IExecutionDMContext dmc, boolean allThreads) { + this(dmc, allThreads, null); + } + + /** + * @since 2.0 + */ + public MIExecInterrupt(IExecutionDMContext dmc, String groupId) { + this(dmc, false, groupId); + } + + /* + * The parameters allThreads and groupId are mutually exclusive. allThreads must be false + * if we are to use groupId. The value of this method is to only have one place + * where we use the hard-coded strings. + */ + private MIExecInterrupt(IExecutionDMContext dmc, boolean allThreads, String groupId) { super(dmc, "-exec-interrupt"); //$NON-NLS-1$ if (allThreads) { setParameters(new String[] { "--all" }); //$NON-NLS-1$ + } else if (groupId != null) { + setParameters(new String[] { "--thread-group", groupId }); //$NON-NLS-1$ } } }