forked from qt-creator/qt-creator
Gdb: Fix shutdown of engine if app exits (gdbserver)
Sometimes the "Remote connection closed" message is the last one we get from gdbserver. handleResultRecord might not be called any more. Change-Id: Ib4c1155bf21c605ac39d75582c1a26676475cb7a Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -607,6 +607,12 @@ void GdbEngine::handleResponse(const QByteArray &buff)
|
||||
// version and/or OS version used.
|
||||
if (data.startsWith("warning:"))
|
||||
showMessage(_(data.mid(9)), AppStuff); // Cut "warning: "
|
||||
|
||||
// Messages when the target exits (gdbserver)
|
||||
if (data.trimmed() == "Remote connection closed"
|
||||
|| data.trimmed() == "Quit") {
|
||||
notifyInferiorExited();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1025,10 +1031,6 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
|
||||
QTC_CHECK(state() == InferiorRunOk);
|
||||
notifyInferiorSpontaneousStop();
|
||||
notifyEngineIll();
|
||||
} else if (msg.startsWith("Remote connection closed")
|
||||
|| msg.startsWith("Quit")) {
|
||||
// Can happen when the target exits (gdbserver)
|
||||
notifyInferiorExited();
|
||||
} else {
|
||||
// Windows: Some DLL or some function not found. Report
|
||||
// the exception now in a box.
|
||||
|
Reference in New Issue
Block a user