Debugger: Ensure termination of lldb.exe

LLDB 12.0.8, which is included in NDK 23.1, hesitates to termiate when
being told to. Calling QtcProcess::stop() and using CtrlCStub on Windows
helps with that.

Amends: 17ff9317cd

Fixes: QTCREATORBUG-27723
Change-Id: Ie9d4ed23a833019f445c1517983c90ae899fbf39
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Alessandro Portale
2022-06-16 10:12:23 +02:00
parent 1e70973c32
commit f873ad1cf0

View File

@@ -189,16 +189,13 @@ void LldbEngine::shutdownInferior()
void LldbEngine::shutdownEngine() void LldbEngine::shutdownEngine()
{ {
QTC_ASSERT(state() == EngineShutdownRequested, qDebug() << state()); QTC_ASSERT(state() == EngineShutdownRequested, qDebug() << state());
if (m_lldbProc.isRunning()) abortDebuggerProcess();
m_lldbProc.terminate();
else
notifyEngineShutdownFinished();
} }
void LldbEngine::abortDebuggerProcess() void LldbEngine::abortDebuggerProcess()
{ {
if (m_lldbProc.isRunning()) if (m_lldbProc.isRunning())
m_lldbProc.kill(); m_lldbProc.stop();
else else
notifyEngineShutdownFinished(); notifyEngineShutdownFinished();
} }
@@ -799,7 +796,7 @@ void LldbEngine::handleLldbError(QProcess::ProcessError error)
case QProcess::Timedout: case QProcess::Timedout:
default: default:
//setState(EngineShutdownRequested, true); //setState(EngineShutdownRequested, true);
m_lldbProc.kill(); m_lldbProc.stop();
AsynchronousMessageBox::critical(tr("LLDB I/O Error"), errorMessage(error)); AsynchronousMessageBox::critical(tr("LLDB I/O Error"), errorMessage(error));
break; break;
} }