diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 45f1afe0319..1d158c49a1b 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -1747,38 +1747,6 @@ void GdbEngine::handleInferiorShutdown(const DebuggerResponse &response) notifyInferiorShutdownFailed(); } -void GdbEngine::notifyAdapterShutdownFailed() -{ - showMessage("ADAPTER SHUTDOWN FAILED"); - CHECK_STATE(EngineShutdownRequested); - notifyEngineShutdownFailed(); -} - -void GdbEngine::notifyAdapterShutdownOk() -{ - CHECK_STATE(EngineShutdownRequested); - showMessage(QString("INITIATE GDBENGINE SHUTDOWN IN STATE %1, PROC: %2") - .arg(lastGoodState()).arg(m_gdbProc.state())); - m_commandsDoneCallback = 0; - switch (m_gdbProc.state()) { - case QProcess::Running: { - if (runParameters().closeMode == KillAndExitMonitorAtClose) - runCommand({"monitor exit"}); - runCommand({"exitGdb", ExitRequest, CB(handleGdbExit)}); - break; - } - case QProcess::NotRunning: - // Cannot find executable. - notifyEngineShutdownOk(); - break; - case QProcess::Starting: - showMessage("GDB NOT REALLY RUNNING; KILLING IT"); - m_gdbProc.kill(); - notifyEngineShutdownFailed(); - break; - } -} - void GdbEngine::handleGdbExit(const DebuggerResponse &response) { if (response.resultClass == ResultExit) { @@ -4146,27 +4114,6 @@ void GdbEngine::notifyInferiorSetupFailedHelper(const QString &msg) notifyInferiorSetupFailed(); } -void GdbEngine::handleAdapterCrashed(const QString &msg) -{ - showMessage("ADAPTER CRASHED"); - - // The adapter is expected to have cleaned up after itself when we get here, - // so the effect is about the same as AdapterStartFailed => use it. - // Don't bother with state transitions - this can happen in any state and - // the end result is always the same, so it makes little sense to find a - // "path" which does not assert. - if (state() == EngineSetupRequested) - notifyEngineSetupFailed(); - else - notifyEngineIll(); - - // No point in being friendly here ... - m_gdbProc.kill(); - - if (!msg.isEmpty()) - AsynchronousMessageBox::critical(tr("Adapter crashed"), msg); -} - void GdbEngine::createFullBacktrace() { DebuggerCommand cmd("thread apply all bt full", NeedsTemporaryStop | ConsoleCommand); @@ -4630,7 +4577,27 @@ void GdbEngine::shutdownEngine() m_outputCollector.shutdown(); } - notifyAdapterShutdownOk(); + CHECK_STATE(EngineShutdownRequested); + showMessage(QString("INITIATE GDBENGINE SHUTDOWN IN STATE %1, PROC: %2") + .arg(lastGoodState()).arg(m_gdbProc.state())); + m_commandsDoneCallback = 0; + switch (m_gdbProc.state()) { + case QProcess::Running: { + if (runParameters().closeMode == KillAndExitMonitorAtClose) + runCommand({"monitor exit"}); + runCommand({"exitGdb", ExitRequest, CB(handleGdbExit)}); + break; + } + case QProcess::NotRunning: + // Cannot find executable. + notifyEngineShutdownOk(); + break; + case QProcess::Starting: + showMessage("GDB NOT REALLY RUNNING; KILLING IT"); + m_gdbProc.kill(); + notifyEngineShutdownFailed(); + break; + } } void GdbEngine::handleFileExecAndSymbols(const DebuggerResponse &response) diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index baad5be0aed..0ae1e876744 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -120,13 +120,6 @@ private: ////////// General Interface ////////// // The engine is still running just fine, but it failed to acquire a debuggee. void notifyInferiorSetupFailedHelper(const QString &msg); - void notifyAdapterShutdownOk(); - void notifyAdapterShutdownFailed(); - - // Something went wrong with the adapter *after* adapterStarted() was emitted. - // Make sure to clean up everything before emitting this signal. - void handleAdapterCrashed(const QString &msg); - void handleGdbFinished(int exitCode, QProcess::ExitStatus exitStatus); void handleGdbError(QProcess::ProcessError error); void readGdbStandardOutput();