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 <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Cristian Adam
2023-11-16 13:26:16 +01:00
parent 240748c106
commit 554bb75ad9

View File

@@ -283,21 +283,23 @@ void LldbEngine::handleLldbStarted()
cmd2.arg("attachpid", attachedPID); cmd2.arg("attachpid", attachedPID);
} else { } else {
cmd2.arg("startmode", rp.startMode); 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 if (rp.startMode != StartInternal) {
// enum values), and thus we assume that if the rp.attachPID is valid we really have to attach // it is better not to check the start mode on the python sid (as we would have to duplicate the
QTC_CHECK(rp.attachPID.isValid() && (rp.startMode == AttachToRemoteProcess // enum values), and thus we assume that if the rp.attachPID is valid we really have to attach
|| rp.startMode == AttachToLocalProcess QTC_CHECK(rp.attachPID.isValid() && (rp.startMode == AttachToRemoteProcess
|| rp.startMode == AttachToRemoteServer)); || rp.startMode == AttachToLocalProcess
cmd2.arg("attachpid", rp.attachPID.pid()); || rp.startMode == AttachToRemoteServer));
cmd2.arg("sysroot", rp.deviceSymbolsRoot.isEmpty() ? rp.sysRoot.toString() cmd2.arg("attachpid", rp.attachPID.pid());
: rp.deviceSymbolsRoot); cmd2.arg("sysroot", rp.deviceSymbolsRoot.isEmpty() ? rp.sysRoot.toString()
cmd2.arg("remotechannel", ((rp.startMode == AttachToRemoteProcess : rp.deviceSymbolsRoot);
|| rp.startMode == AttachToRemoteServer) cmd2.arg("remotechannel", ((rp.startMode == AttachToRemoteProcess
? rp.remoteChannel : QString())); || rp.startMode == AttachToRemoteServer)
QTC_CHECK(!rp.continueAfterAttach || (rp.startMode == AttachToRemoteProcess ? rp.remoteChannel : QString()));
|| rp.startMode == AttachToLocalProcess QTC_CHECK(!rp.continueAfterAttach || (rp.startMode == AttachToRemoteProcess
|| rp.startMode == AttachToRemoteServer)); || rp.startMode == AttachToLocalProcess
m_continueAtNextSpontaneousStop = false; || rp.startMode == AttachToRemoteServer));
m_continueAtNextSpontaneousStop = false;
}
} }
cmd2.callback = [this](const DebuggerResponse &response) { cmd2.callback = [this](const DebuggerResponse &response) {