Index: MIInferior.java =================================================================== RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MIInferior.java,v retrieving revision 1.7 diff -u -r1.7 MIInferior.java --- MIInferior.java 17 Nov 2004 15:39:15 -0000 1.7 +++ MIInferior.java 19 Nov 2004 14:48:13 -0000 @@ -159,31 +159,22 @@ } public void terminate() throws MIException { - // An inferior will be destroy():interrupt and kill if - // - For attach session: - // the inferior was not disconnected yet (no need to try - // to kill a disconnected program). - // - For Program session: - // if the inferior was not terminated. - // - For PostMortem(Core): send event - // else noop - if ((session.isAttachSession() && isConnected()) || (session.isProgramSession() && !isTerminated())) { - // Try to interrupt the inferior, first. - if (isRunning()) { - interrupt(); - } - int token = 0; - if (isSuspended()) { - CommandFactory factory = session.getCommandFactory(); - MIExecAbort abort = factory.createMIExecAbort(); - session.postCommand0(abort, session.getCommandTimeout()); - abort.getMIInfo(); - token = abort.getToken(); - } - setTerminated(token, true); - } else if (session.isCoreSession() && !isTerminated()){ - setTerminated(); - } + // never mind why the debugger ended up in the state that it is + // in. just execute a "kill", ignore result, + "exit" + // + // + try + { + CommandFactory factory = session.getCommandFactory(); + MIExecAbort abort = factory.createMIExecAbort(); + session.postCommand0(abort, session.getCommandTimeout()); + abort.getMIInfo(); + } catch (MIException e) + { + // ignore error. An error is expected when terminate is + // executed on a target that is in the disconnected state. + } + setTerminated(); } public void interrupt() throws MIException {