diff options
author | Marc Khouzam | 2009-07-07 20:21:21 +0000 |
---|---|---|
committer | Marc Khouzam | 2009-07-07 20:21:21 +0000 |
commit | 95a7a2d1ea5f634a77bbfcd301a84fbf13954482 (patch) | |
tree | 14e9eecdfa3c74ce987cd2d93d3deeec8ab41ef2 | |
parent | 98c0f72c1395d26177cfb5da3c3ed46b4a83ea71 (diff) | |
download | org.eclipse.cdt-95a7a2d1ea5f634a77bbfcd301a84fbf13954482.tar.gz org.eclipse.cdt-95a7a2d1ea5f634a77bbfcd301a84fbf13954482.tar.xz org.eclipse.cdt-95a7a2d1ea5f634a77bbfcd301a84fbf13954482.zip |
[279293] When a process is selected, we should only resume/interrupt that process, instead of _all_ attached processes!
3 files changed, 47 insertions, 8 deletions
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<MIInfo>(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<MIInfo>(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<MIInfo>(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..4f5cd9b99a3 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<MIInfo> * @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..17c953033c0 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<MIInfo> * @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$ } } } |