From 554bb75ad931f111060a5ec4e09b6ec8b92c0995 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Thu, 16 Nov 2023 13:26:16 +0100 Subject: [PATCH] Debugger: Fix assert when starting local debug When starting a local debugging session and the terminal is not used, no reason to assert that the remote pid is not valid etc. Change-Id: I1b62a98721425784ca80ce9261b07475c19f3ba1 Reviewed-by: hjk Reviewed-by: Christian Stenger Reviewed-by: --- src/plugins/debugger/lldb/lldbengine.cpp | 32 +++++++++++++----------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 12da7a86fc4..fa6fcae29c4 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -283,21 +283,23 @@ void LldbEngine::handleLldbStarted() cmd2.arg("attachpid", attachedPID); } else { cmd2.arg("startmode", rp.startMode); - // it is better not to check the start mode on the python sid (as we would have to duplicate the - // enum values), and thus we assume that if the rp.attachPID is valid we really have to attach - QTC_CHECK(rp.attachPID.isValid() && (rp.startMode == AttachToRemoteProcess - || rp.startMode == AttachToLocalProcess - || rp.startMode == AttachToRemoteServer)); - cmd2.arg("attachpid", rp.attachPID.pid()); - cmd2.arg("sysroot", rp.deviceSymbolsRoot.isEmpty() ? rp.sysRoot.toString() - : rp.deviceSymbolsRoot); - cmd2.arg("remotechannel", ((rp.startMode == AttachToRemoteProcess - || rp.startMode == AttachToRemoteServer) - ? rp.remoteChannel : QString())); - QTC_CHECK(!rp.continueAfterAttach || (rp.startMode == AttachToRemoteProcess - || rp.startMode == AttachToLocalProcess - || rp.startMode == AttachToRemoteServer)); - m_continueAtNextSpontaneousStop = false; + if (rp.startMode != StartInternal) { + // it is better not to check the start mode on the python sid (as we would have to duplicate the + // enum values), and thus we assume that if the rp.attachPID is valid we really have to attach + QTC_CHECK(rp.attachPID.isValid() && (rp.startMode == AttachToRemoteProcess + || rp.startMode == AttachToLocalProcess + || rp.startMode == AttachToRemoteServer)); + cmd2.arg("attachpid", rp.attachPID.pid()); + cmd2.arg("sysroot", rp.deviceSymbolsRoot.isEmpty() ? rp.sysRoot.toString() + : rp.deviceSymbolsRoot); + cmd2.arg("remotechannel", ((rp.startMode == AttachToRemoteProcess + || rp.startMode == AttachToRemoteServer) + ? rp.remoteChannel : QString())); + QTC_CHECK(!rp.continueAfterAttach || (rp.startMode == AttachToRemoteProcess + || rp.startMode == AttachToLocalProcess + || rp.startMode == AttachToRemoteServer)); + m_continueAtNextSpontaneousStop = false; + } } cmd2.callback = [this](const DebuggerResponse &response) {