mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
new method terminate() to allow to pass the exception.
This commit is contained in:
parent
4ec086bfd1
commit
1c9df5cdbd
1 changed files with 13 additions and 8 deletions
|
@ -142,6 +142,14 @@ public class MIInferior extends Process {
|
||||||
* @see java.lang.Process#destroy()
|
* @see java.lang.Process#destroy()
|
||||||
*/
|
*/
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
|
try {
|
||||||
|
terminate();
|
||||||
|
} catch (MIException e) {
|
||||||
|
// do nothing.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void terminate() throws MIException {
|
||||||
// An inferior will be destroy():interrupt and kill if
|
// An inferior will be destroy():interrupt and kill if
|
||||||
// - For attach session:
|
// - For attach session:
|
||||||
// the inferior was not disconnected yet (no need to try
|
// the inferior was not disconnected yet (no need to try
|
||||||
|
@ -153,14 +161,11 @@ public class MIInferior extends Process {
|
||||||
|
|
||||||
CommandFactory factory = session.getCommandFactory();
|
CommandFactory factory = session.getCommandFactory();
|
||||||
MIExecAbort abort = factory.createMIExecAbort();
|
MIExecAbort abort = factory.createMIExecAbort();
|
||||||
try {
|
// Try to interrupt the inferior, first.
|
||||||
// Try to interrupt the inferior, first.
|
interrupt();
|
||||||
interrupt();
|
session.postCommand(abort);
|
||||||
session.postCommand(abort);
|
abort.getMIInfo();
|
||||||
abort.getMIInfo();
|
setTerminated(abort.getToken(), true);
|
||||||
setTerminated(abort.getToken(), true);
|
|
||||||
} catch (MIException e) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue