1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 09:16:02 +02:00

Disallow sending command while the target is running.

This commit is contained in:
Alain Magloire 2002-08-20 18:30:41 +00:00
parent a96bbc512e
commit 695be49d49

View file

@ -13,6 +13,8 @@ import java.util.Observable;
import org.eclipse.cdt.debug.mi.core.command.Command;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIExecAbort;
import org.eclipse.cdt.debug.mi.core.command.MIExecInterrupt;
import org.eclipse.cdt.debug.mi.core.command.MIGDBExit;
import org.eclipse.cdt.debug.mi.core.command.MIGDBSet;
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
@ -85,11 +87,11 @@ public class MISession extends Observable {
postCommand(confirm);
info = confirm.getMIInfo();
MIGDBSet width = new MIGDBSet(new String[]{"width", "99999999"});
MIGDBSet width = new MIGDBSet(new String[]{"width", "0"});
postCommand(width);
info = confirm.getMIInfo();
MIGDBSet height = new MIGDBSet(new String[]{"height", "99999999"});
MIGDBSet height = new MIGDBSet(new String[]{"height", "0"});
postCommand(height);
info = confirm.getMIInfo();
} catch (MIException e) {
@ -176,6 +178,14 @@ MIPlugin.getDefault().debugLog(number++ + " " + cmd.toString());
throw new MIException("{R,T}xThread terminated");
}
// Test if we are in the right state?
if (inferior.isRunning()) {
if ( !((cmd instanceof MIExecInterrupt) ||
cmd instanceof MIExecAbort)) {
throw new MIException("Target running");
}
}
txQueue.addCommand(cmd);
// Wait for the response or timedout