private void command_terminateExecution (String info) {
// Set the quit flag for the CAL execution thread and then
// let it resume execution. This lets the CAL program terminate
// gracefully.
ExecutionContextImpl ec = getExecutionContext();
// Remember the state of tracing and then turn it off.
boolean traceOn = ec.isTracingEnabled();
ec.setTracingEnabled(false);
Set<String> breakpoints = ec.getBreakpoints();
ec.clearBreakpoints();
Set<String> tracedFunctions = ec.getTracedFunctions();
// We want to go into a loop here in case
// we hit another breakpoint before the machine
// notices that a quit has been requested.
while (ec.hasSuspendedThreads()) {
ec.setStepping(false);
ICE.this.runThread.requestQuit();
getDebugController().setShouldBlockUI(true);
ec.resumeAll();
getDebugController().blockUntilCompletionOrInterruption();
}
ec.setTracingEnabled(traceOn);
ec.setTracedFunctions(tracedFunctions);
ec.setBreakpoints(breakpoints);
}