Commit 22a949b5 authored by Kai Koehne's avatar Kai Koehne Committed by hjk

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: default avatarhjk <qthjk@ovi.com>
parent dde2c51e
...@@ -607,6 +607,12 @@ void GdbEngine::handleResponse(const QByteArray &buff) ...@@ -607,6 +607,12 @@ void GdbEngine::handleResponse(const QByteArray &buff)
// version and/or OS version used. // version and/or OS version used.
if (data.startsWith("warning:")) if (data.startsWith("warning:"))
showMessage(_(data.mid(9)), AppStuff); // Cut "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; break;
} }
...@@ -1025,10 +1031,6 @@ void GdbEngine::handleResultRecord(GdbResponse *response) ...@@ -1025,10 +1031,6 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
QTC_CHECK(state() == InferiorRunOk); QTC_CHECK(state() == InferiorRunOk);
notifyInferiorSpontaneousStop(); notifyInferiorSpontaneousStop();
notifyEngineIll(); notifyEngineIll();
} else if (msg.startsWith("Remote connection closed")
|| msg.startsWith("Quit")) {
// Can happen when the target exits (gdbserver)
notifyInferiorExited();
} else { } else {
// Windows: Some DLL or some function not found. Report // Windows: Some DLL or some function not found. Report
// the exception now in a box. // the exception now in a box.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment