1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-01 05:15:43 +02:00

Try to detect when gdb dies unexpectely(sp?).

This commit is contained in:
Alain Magloire 2002-09-07 14:48:26 +00:00
parent c437685dfd
commit 42e4cbf928

View file

@ -73,22 +73,22 @@ MIPlugin.getDefault().debugLog(line);
} }
} catch (IOException e) { } catch (IOException e) {
//e.printStackTrace(); //e.printStackTrace();
// This code should be executed when gdb been abruptly }
// or unxepectedly killed. This is detected by checking // This code should be executed when gdb been abruptly
// if the channelInputStream is not null. In normal case // or unxepectedly killed. This is detected by checking
// session.terminate() will set the channelInputStream to null. // if the channelInputStream is not null. In normal case
if (session.getChannelInputStream() != null) { // session.terminate() will set the channelInputStream to null.
Runnable cleanup = new Runnable() { if (session.getChannelInputStream() != null) {
public void run() { Runnable cleanup = new Runnable() {
// Change the state of the inferior. public void run() {
session.getMIInferior().setTerminated(); // Change the state of the inferior.
session.terminate(); session.getMIInferior().setTerminated();
} session.terminate();
}; }
Thread clean = new Thread(cleanup, "GDB Died"); };
clean.setDaemon(true); Thread clean = new Thread(cleanup, "GDB Died");
clean.start(); clean.setDaemon(true);
} clean.start();
} }
} }