forked from qt-creator/qt-creator
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:
@@ -1747,38 +1747,6 @@ void GdbEngine::handleInferiorShutdown(const DebuggerResponse &response)
|
|||||||
notifyInferiorShutdownFailed();
|
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)
|
void GdbEngine::handleGdbExit(const DebuggerResponse &response)
|
||||||
{
|
{
|
||||||
if (response.resultClass == ResultExit) {
|
if (response.resultClass == ResultExit) {
|
||||||
@@ -4146,27 +4114,6 @@ void GdbEngine::notifyInferiorSetupFailedHelper(const QString &msg)
|
|||||||
notifyInferiorSetupFailed();
|
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()
|
void GdbEngine::createFullBacktrace()
|
||||||
{
|
{
|
||||||
DebuggerCommand cmd("thread apply all bt full", NeedsTemporaryStop | ConsoleCommand);
|
DebuggerCommand cmd("thread apply all bt full", NeedsTemporaryStop | ConsoleCommand);
|
||||||
@@ -4630,7 +4577,27 @@ void GdbEngine::shutdownEngine()
|
|||||||
m_outputCollector.shutdown();
|
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)
|
void GdbEngine::handleFileExecAndSymbols(const DebuggerResponse &response)
|
||||||
|
@@ -120,13 +120,6 @@ private: ////////// General Interface //////////
|
|||||||
// The engine is still running just fine, but it failed to acquire a debuggee.
|
// The engine is still running just fine, but it failed to acquire a debuggee.
|
||||||
void notifyInferiorSetupFailedHelper(const QString &msg);
|
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 handleGdbFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
||||||
void handleGdbError(QProcess::ProcessError error);
|
void handleGdbError(QProcess::ProcessError error);
|
||||||
void readGdbStandardOutput();
|
void readGdbStandardOutput();
|
||||||
|
Reference in New Issue
Block a user