1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +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) {
//e.printStackTrace();
// This code should be executed when gdb been abruptly
// or unxepectedly killed. This is detected by checking
// if the channelInputStream is not null. In normal case
// session.terminate() will set the channelInputStream to null.
if (session.getChannelInputStream() != null) {
Runnable cleanup = new Runnable() {
public void run() {
// Change the state of the inferior.
session.getMIInferior().setTerminated();
session.terminate();
}
};
Thread clean = new Thread(cleanup, "GDB Died");
clean.setDaemon(true);
clean.start();
}
}
// This code should be executed when gdb been abruptly
// or unxepectedly killed. This is detected by checking
// if the channelInputStream is not null. In normal case
// session.terminate() will set the channelInputStream to null.
if (session.getChannelInputStream() != null) {
Runnable cleanup = new Runnable() {
public void run() {
// Change the state of the inferior.
session.getMIInferior().setTerminated();
session.terminate();
}
};
Thread clean = new Thread(cleanup, "GDB Died");
clean.setDaemon(true);
clean.start();
}
}