mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 339047: No need to interrupt the inferior in non-stop mode
This commit is contained in:
parent
218111e722
commit
32bf5a5a1d
7 changed files with 35 additions and 8 deletions
|
@ -43,11 +43,11 @@ import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext;
|
|||
import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIProcessDMContext;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIProcesses;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIRunControl;
|
||||
import org.eclipse.cdt.dsf.mi.service.MIBreakpointsManager;
|
||||
import org.eclipse.cdt.dsf.mi.service.MIProcesses;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.CommandFactory;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.MIInferiorProcess;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.MIInferiorProcess.State;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.events.MIStoppedEvent;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIBreakInsertInfo;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
|
||||
|
@ -370,7 +370,8 @@ public class GDBProcesses extends MIProcesses implements IGDBProcesses {
|
|||
@Override
|
||||
protected void handleSuccess() {
|
||||
if (getData() instanceof IMIContainerDMContext) {
|
||||
if (fGdb.getInferiorProcess().getState() == State.RUNNING) {
|
||||
IMIRunControl runControl = getServicesTracker().getService(IMIRunControl.class);
|
||||
if (runControl != null && !runControl.isTargetAcceptingCommands()) {
|
||||
fBackend.interrupt();
|
||||
}
|
||||
|
||||
|
|
|
@ -58,11 +58,11 @@ import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext;
|
|||
import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIProcessDMContext;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIProcesses;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIRunControl;
|
||||
import org.eclipse.cdt.dsf.mi.service.MIBreakpointsManager;
|
||||
import org.eclipse.cdt.dsf.mi.service.MIProcesses;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.CommandFactory;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.MIInferiorProcess;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.MIInferiorProcess.State;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.events.MIThreadGroupCreatedEvent;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.events.MIThreadGroupExitedEvent;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIConst;
|
||||
|
@ -1134,7 +1134,8 @@ public class GDBProcesses_7_0 extends AbstractDsfService
|
|||
@Override
|
||||
protected void handleSuccess() {
|
||||
if (getData() instanceof IMIContainerDMContext) {
|
||||
if (fCommandControl.getInferiorProcess().getState() == State.RUNNING) {
|
||||
IMIRunControl runControl = getServicesTracker().getService(IMIRunControl.class);
|
||||
if (runControl != null && !runControl.isTargetAcceptingCommands()) {
|
||||
fBackend.interrupt();
|
||||
}
|
||||
|
||||
|
|
|
@ -1481,6 +1481,12 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService implements IMIRunCo
|
|||
return MIRunMode.NON_STOP;
|
||||
}
|
||||
|
||||
/** @since 4.0 */
|
||||
public boolean isTargetAcceptingCommands() {
|
||||
// Always accepting commands in non-stop mode
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* See bug 196154
|
||||
*
|
||||
|
|
|
@ -39,13 +39,13 @@ import org.eclipse.cdt.dsf.gdb.service.SessionType;
|
|||
import org.eclipse.cdt.dsf.mi.service.IMIBackend;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIBackend.BackendStateChangedEvent;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMICommandControl;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIRunControl;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.AbstractCLIProcess;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.AbstractMIControl;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.CLIEventProcessor;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.CommandFactory;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.MIControlDMContext;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.MIInferiorProcess;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.MIInferiorProcess.State;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.MIRunControlEventProcessor;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
|
||||
import org.eclipse.cdt.dsf.service.DsfServiceEventHandler;
|
||||
|
@ -179,7 +179,8 @@ public class GDBControl extends AbstractMIControl implements IGDBControl {
|
|||
// Interrupt GDB in case the inferior is running.
|
||||
// That way, the inferior will also be killed when we exit GDB.
|
||||
//
|
||||
if (fInferiorProcess.getState() == State.RUNNING) {
|
||||
IMIRunControl runControl = getServicesTracker().getService(IMIRunControl.class);
|
||||
if (runControl != null && !runControl.isTargetAcceptingCommands()) {
|
||||
fMIBackend.interrupt();
|
||||
}
|
||||
|
||||
|
|
|
@ -40,13 +40,13 @@ import org.eclipse.cdt.dsf.gdb.service.SessionType;
|
|||
import org.eclipse.cdt.dsf.mi.service.IMIBackend;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIBackend.BackendStateChangedEvent;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMICommandControl;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIRunControl;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.AbstractCLIProcess;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.AbstractMIControl;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.CLIEventProcessor_7_0;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.CommandFactory;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.MIControlDMContext;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.MIInferiorProcess;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.MIInferiorProcess.State;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.MIRunControlEventProcessor_7_0;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIListFeaturesInfo;
|
||||
|
@ -183,7 +183,8 @@ public class GDBControl_7_0 extends AbstractMIControl implements IGDBControl {
|
|||
// Interrupt GDB in case the inferior is running.
|
||||
// That way, the inferior will also be killed when we exit GDB.
|
||||
//
|
||||
if (fInferiorProcess.getState() == State.RUNNING) {
|
||||
IMIRunControl runControl = getServicesTracker().getService(IMIRunControl.class);
|
||||
if (runControl != null && !runControl.isTargetAcceptingCommands()) {
|
||||
fMIBackend.interrupt();
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,13 @@ import org.eclipse.cdt.dsf.debug.service.IRunControl2;
|
|||
*/
|
||||
public interface IMIRunControl extends IRunControl2
|
||||
{
|
||||
/**
|
||||
* Returns true if the target currently accepting commands.
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public boolean isTargetAcceptingCommands();
|
||||
|
||||
/**
|
||||
* Request that the specified steps be executed by first ensuring the target is available
|
||||
* to receive commands. Once the specified steps are executed, the target should be
|
||||
|
|
|
@ -1250,4 +1250,14 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
|
|||
public IRunMode getRunMode() {
|
||||
return MIRunMode.ALL_STOP;
|
||||
}
|
||||
|
||||
/** @since 4.0 */
|
||||
public boolean isTargetAcceptingCommands() {
|
||||
// For all-stop mode:
|
||||
// 1- if GDB is not terminated and
|
||||
// 2- if execution is suspended and
|
||||
// 3- if we didn't just send a resume/stop command, then
|
||||
// we know GDB is accepting commands
|
||||
return !fTerminated && fSuspended && !fResumePending;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue