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);
} 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) {