Debugger: Cleanup some GdbEngine code paths

Either dead code, or "Adapter" related abstractions that are not
used anymore.

Change-Id: I1f2418db13d4891d36c10b488c522582eff8afc5
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
hjk
2017-09-27 16:53:57 +02:00
parent 82b22a552f
commit b268abb100
2 changed files with 21 additions and 61 deletions

View File

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

View File

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