mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Implement suspend with spawner.
This commit is contained in:
parent
9bfdedea05
commit
0182fc06d9
1 changed files with 10 additions and 5 deletions
|
@ -20,11 +20,11 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
|
||||||
import org.eclipse.cdt.debug.mi.core.MIException;
|
import org.eclipse.cdt.debug.mi.core.MIException;
|
||||||
import org.eclipse.cdt.debug.mi.core.MISession;
|
import org.eclipse.cdt.debug.mi.core.MISession;
|
||||||
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
|
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
|
||||||
|
import org.eclipse.cdt.debug.mi.core.command.MICommand;
|
||||||
import org.eclipse.cdt.debug.mi.core.command.MIDataEvaluateExpression;
|
import org.eclipse.cdt.debug.mi.core.command.MIDataEvaluateExpression;
|
||||||
import org.eclipse.cdt.debug.mi.core.command.MIDataListRegisterNames;
|
import org.eclipse.cdt.debug.mi.core.command.MIDataListRegisterNames;
|
||||||
import org.eclipse.cdt.debug.mi.core.command.MIExecContinue;
|
import org.eclipse.cdt.debug.mi.core.command.MIExecContinue;
|
||||||
import org.eclipse.cdt.debug.mi.core.command.MIExecFinish;
|
import org.eclipse.cdt.debug.mi.core.command.MIExecFinish;
|
||||||
import org.eclipse.cdt.debug.mi.core.command.MIExecInterrupt;
|
|
||||||
import org.eclipse.cdt.debug.mi.core.command.MIExecNext;
|
import org.eclipse.cdt.debug.mi.core.command.MIExecNext;
|
||||||
import org.eclipse.cdt.debug.mi.core.command.MIExecNextInstruction;
|
import org.eclipse.cdt.debug.mi.core.command.MIExecNextInstruction;
|
||||||
import org.eclipse.cdt.debug.mi.core.command.MIExecRun;
|
import org.eclipse.cdt.debug.mi.core.command.MIExecRun;
|
||||||
|
@ -339,12 +339,13 @@ public class CTarget implements ICDITarget {
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#suspend()
|
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#suspend()
|
||||||
*/
|
*/
|
||||||
public void suspend() throws CDIException {
|
public void suspend() throws CDIException {
|
||||||
|
session.getMISession().getMIInferior().interrupt();
|
||||||
|
// send a noop to see if we get an aswer.
|
||||||
MISession mi = session.getMISession();
|
MISession mi = session.getMISession();
|
||||||
CommandFactory factory = mi.getCommandFactory();
|
MICommand noop = new MICommand("");
|
||||||
MIExecInterrupt interrupt = factory.createMIExecInterrupt();
|
|
||||||
try {
|
try {
|
||||||
mi.postCommand(interrupt);
|
mi.postCommand(noop);
|
||||||
MIInfo info = interrupt.getMIInfo();
|
MIInfo info = noop.getMIInfo();
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
throw new CDIException("No answer");
|
throw new CDIException("No answer");
|
||||||
}
|
}
|
||||||
|
@ -439,6 +440,10 @@ public class CTarget implements ICDITarget {
|
||||||
return session.getMISession().getMIInferior().isSuspended();
|
return session.getMISession().getMIInferior().isSuspended();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isRunning() {
|
||||||
|
return session.getMISession().getMIInferior().isRunning();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#getGlobalVariables()
|
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#getGlobalVariables()
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue