forked from qt-creator/qt-creator
-gdb-exit has a special return code as well
This commit is contained in:
@@ -130,7 +130,7 @@ void AttachGdbAdapter::shutdown()
|
|||||||
|
|
||||||
case InferiorShutDown:
|
case InferiorShutDown:
|
||||||
setState(AdapterShuttingDown);
|
setState(AdapterShuttingDown);
|
||||||
m_engine->postCommand(_("-gdb-exit"), CB(handleExit));
|
m_engine->postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleExit));
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ void CoreGdbAdapter::shutdown()
|
|||||||
case InferiorUnrunnable:
|
case InferiorUnrunnable:
|
||||||
case InferiorShutDown:
|
case InferiorShutDown:
|
||||||
setState(AdapterShuttingDown);
|
setState(AdapterShuttingDown);
|
||||||
m_engine->postCommand(_("-gdb-exit"), CB(handleExit));
|
m_engine->postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleExit));
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -803,10 +803,12 @@ void GdbEngine::handleResultRecord(const GdbResponse &response)
|
|||||||
responseWithCookie.cookie = cmd.cookie;
|
responseWithCookie.cookie = cmd.cookie;
|
||||||
|
|
||||||
if (response.resultClass != GdbResultError &&
|
if (response.resultClass != GdbResultError &&
|
||||||
response.resultClass != ((cmd.flags & RunRequest) ? GdbResultRunning : GdbResultDone)) {
|
response.resultClass != ((cmd.flags & RunRequest) ? GdbResultRunning :
|
||||||
debugMessage(_("UNEXPECTED RESPONSE %1 TO COMMAND %2")
|
(cmd.flags & ExitRequest) ? GdbResultExit :
|
||||||
.arg(_(GdbResponse::stringFromResultClass(response.resultClass)))
|
GdbResultDone)) {
|
||||||
.arg(cmd.command));
|
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 {
|
} else {
|
||||||
if (cmd.callback)
|
if (cmd.callback)
|
||||||
(this->*cmd.callback)(responseWithCookie);
|
(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
|
RebuildModel = 4, // Trigger model rebuild when no such commands are pending any more
|
||||||
WatchUpdate = Discardable | RebuildModel,
|
WatchUpdate = Discardable | RebuildModel,
|
||||||
EmbedToken = 8, // Expand %1 in the command to the command token
|
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)
|
Q_DECLARE_FLAGS(GdbCommandFlags, GdbCommandFlag)
|
||||||
|
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ void PlainGdbAdapter::shutdown()
|
|||||||
|
|
||||||
case InferiorShutDown:
|
case InferiorShutDown:
|
||||||
setState(AdapterShuttingDown);
|
setState(AdapterShuttingDown);
|
||||||
m_engine->postCommand(_("-gdb-exit"), CB(handleExit));
|
m_engine->postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleExit));
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -192,7 +192,7 @@ void PlainGdbAdapter::shutdown()
|
|||||||
.arg(state()));
|
.arg(state()));
|
||||||
m_gdbProc.kill();
|
m_gdbProc.kill();
|
||||||
}
|
}
|
||||||
m_engine->postCommand(_("-gdb-exit"), CB(handleExit));
|
m_engine->postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleExit));
|
||||||
return;
|
return;
|
||||||
*/
|
*/
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ void RemoteGdbAdapter::shutdown()
|
|||||||
case InferiorStartFailed:
|
case InferiorStartFailed:
|
||||||
case InferiorShutDown:
|
case InferiorShutDown:
|
||||||
setState(AdapterShuttingDown);
|
setState(AdapterShuttingDown);
|
||||||
m_engine->postCommand(_("-gdb-exit"), CB(handleExit));
|
m_engine->postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleExit));
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2015,7 +2015,7 @@ void TrkGdbAdapter::shutdown()
|
|||||||
case InferiorShutDown:
|
case InferiorShutDown:
|
||||||
setState(AdapterShuttingDown);
|
setState(AdapterShuttingDown);
|
||||||
cleanup();
|
cleanup();
|
||||||
m_engine->postCommand(_("-gdb-exit"), CB(handleExit));
|
m_engine->postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleExit));
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user