Commit 70f696d0 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

-gdb-exit has a special return code as well

parent 98b477fc
......@@ -130,7 +130,7 @@ void AttachGdbAdapter::shutdown()
case InferiorShutDown:
setState(AdapterShuttingDown);
m_engine->postCommand(_("-gdb-exit"), CB(handleExit));
m_engine->postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleExit));
return;
default:
......
......@@ -192,7 +192,7 @@ void CoreGdbAdapter::shutdown()
case InferiorUnrunnable:
case InferiorShutDown:
setState(AdapterShuttingDown);
m_engine->postCommand(_("-gdb-exit"), CB(handleExit));
m_engine->postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleExit));
return;
default:
......
......@@ -803,10 +803,12 @@ void GdbEngine::handleResultRecord(const GdbResponse &response)
responseWithCookie.cookie = cmd.cookie;
if (response.resultClass != GdbResultError &&
response.resultClass != ((cmd.flags & RunRequest) ? GdbResultRunning : GdbResultDone)) {
debugMessage(_("UNEXPECTED RESPONSE %1 TO COMMAND %2")
.arg(_(GdbResponse::stringFromResultClass(response.resultClass)))
.arg(cmd.command));
response.resultClass != ((cmd.flags & RunRequest) ? GdbResultRunning :
(cmd.flags & ExitRequest) ? GdbResultExit :
GdbResultDone)) {
QString rsp = _(GdbResponse::stringFromResultClass(response.resultClass));
qWarning() << "UNEXPECTED RESPONSE " << rsp << " TO COMMAND" << cmd.command << " AT " __FILE__ ":" STRINGIFY(__LINE__);
debugMessage(_("UNEXPECTED RESPONSE %1 TO COMMAND %2").arg(rsp).arg(cmd.command));
} else {
if (cmd.callback)
(this->*cmd.callback)(responseWithCookie);
......
......@@ -177,7 +177,8 @@ public: // otherwise the Qt flag macros are unhappy
RebuildModel = 4, // Trigger model rebuild when no such commands are pending any more
WatchUpdate = Discardable | RebuildModel,
EmbedToken = 8, // Expand %1 in the command to the command token
RunRequest = 16 // Callback expect GdbResultRunning instead of GdbResultDone
RunRequest = 16, // Callback expect GdbResultRunning instead of GdbResultDone
ExitRequest = 32 // Callback expect GdbResultExit instead of GdbResultDone
};
Q_DECLARE_FLAGS(GdbCommandFlags, GdbCommandFlag)
......
......@@ -177,7 +177,7 @@ void PlainGdbAdapter::shutdown()
case InferiorShutDown:
setState(AdapterShuttingDown);
m_engine->postCommand(_("-gdb-exit"), CB(handleExit));
m_engine->postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleExit));
return;
/*
......@@ -192,7 +192,7 @@ void PlainGdbAdapter::shutdown()
.arg(state()));
m_gdbProc.kill();
}
m_engine->postCommand(_("-gdb-exit"), CB(handleExit));
m_engine->postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleExit));
return;
*/
default:
......
......@@ -248,7 +248,7 @@ void RemoteGdbAdapter::shutdown()
case InferiorStartFailed:
case InferiorShutDown:
setState(AdapterShuttingDown);
m_engine->postCommand(_("-gdb-exit"), CB(handleExit));
m_engine->postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleExit));
return;
}
......
......@@ -2015,7 +2015,7 @@ void TrkGdbAdapter::shutdown()
case InferiorShutDown:
setState(AdapterShuttingDown);
cleanup();
m_engine->postCommand(_("-gdb-exit"), CB(handleExit));
m_engine->postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleExit));
return;
/*
......
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