Commit b76651bd authored by hjk's avatar hjk

Debugger: Do not duplicate state

GdbEngine::m_startMode should be always the same as in the RunParameters.

Change-Id: Iceac9b28b8273847f7ee518572d93e796fffeb14
Reviewed-by: David Schulz's avatarDavid Schulz <david.schulz@qt.io>
parent ca56ac1a
...@@ -1782,7 +1782,7 @@ void GdbEngine::setLinuxOsAbi() ...@@ -1782,7 +1782,7 @@ void GdbEngine::setLinuxOsAbi()
void GdbEngine::detachDebugger() void GdbEngine::detachDebugger()
{ {
CHECK_STATE(InferiorStopOk); CHECK_STATE(InferiorStopOk);
QTC_ASSERT(m_startMode != AttachCore, qDebug() << m_startMode); QTC_CHECK(runParameters().startMode != AttachCore);
DebuggerCommand cmd("detach", ExitRequest); DebuggerCommand cmd("detach", ExitRequest);
cmd.callback = [this](const DebuggerResponse &) { cmd.callback = [this](const DebuggerResponse &) {
CHECK_STATE(InferiorStopOk); CHECK_STATE(InferiorStopOk);
...@@ -4242,17 +4242,18 @@ bool GdbEngine::isPlainEngine() const ...@@ -4242,17 +4242,18 @@ bool GdbEngine::isPlainEngine() const
bool GdbEngine::isCoreEngine() const bool GdbEngine::isCoreEngine() const
{ {
return m_startMode == AttachCore; return runParameters().startMode == AttachCore;
} }
bool GdbEngine::isRemoteEngine() const bool GdbEngine::isRemoteEngine() const
{ {
return m_startMode == StartRemoteProcess || m_startMode == AttachToRemoteServer; DebuggerStartMode startMode = runParameters().startMode;
return startMode == StartRemoteProcess || startMode == AttachToRemoteServer;
} }
bool GdbEngine::isAttachEngine() const bool GdbEngine::isAttachEngine() const
{ {
return m_startMode == AttachExternal; return runParameters().startMode == AttachExternal;
} }
bool GdbEngine::isTermEngine() const bool GdbEngine::isTermEngine() const
......
...@@ -442,7 +442,6 @@ private: ////////// General Interface ////////// ...@@ -442,7 +442,6 @@ private: ////////// General Interface //////////
Utils::QtcProcess m_gdbProc; Utils::QtcProcess m_gdbProc;
OutputCollector m_outputCollector; OutputCollector m_outputCollector;
QString m_errorString; QString m_errorString;
DebuggerStartMode m_startMode = NoStartMode;
}; };
} // namespace Internal } // namespace Internal
......
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