mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-19 06:55:23 +02:00
[279293] When a process is selected, we should only resume/interrupt that process, instead of _all_ attached processes!
This commit is contained in:
parent
cb443c104d
commit
020347ad23
3 changed files with 47 additions and 8 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
@ -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$
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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$
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue