-gdb-exit has a special return code as well

This commit is contained in:
Oswald Buddenhagen
2009-10-13 17:13:19 +02:00
parent 98b477fc32
commit 70f696d056
7 changed files with 14 additions and 11 deletions

View File

@@ -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:

View File

@@ -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:

View File

@@ -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);

View File

@@ -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)

View File

@@ -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:

View File

@@ -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;
}

View File

@@ -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;
/*