Debugger: Transform DebuggerRunParameters::continueAfterAttach

Task-number: QTCREATORBUG-29168
Change-Id: I276abe8ec00fb83b427782feba7a282806ea4a99
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2025-01-10 14:20:22 +01:00
parent 6d5d413bde
commit 7150411c51
10 changed files with 13 additions and 16 deletions

View File

@@ -122,7 +122,7 @@ public:
rp.setStartMode(Debugger::AttachToRemoteServer);
rp.setCloseMode(KillAndExitMonitorAtClose);
rp.setUseContinueInsteadOfRun(true);
worker->setContinueAfterAttach(true);
rp.setContinueAfterAttach(true);
rp.addSolibSearchDir("%{sysroot}/system/lib");
auto debuggee = createQdbDeviceInferiorWorker(runControl, QmlDebuggerServices);

View File

@@ -158,7 +158,9 @@ public:
}
QString deviceSymbolsRoot() const { return m_deviceSymbolsRoot; }
bool continueAfterAttach = false;
void setContinueAfterAttach(bool on) { m_continueAfterAttach = on; }
bool continueAfterAttach() const { return m_continueAfterAttach; }
Utils::FilePath sysRoot;
// iOS 17+
QString deviceUuid;
@@ -262,6 +264,7 @@ private:
QString m_lldbPlatform;
QString m_deviceSymbolsRoot;
bool m_continueAfterAttach = false;
};
namespace Internal {

View File

@@ -1678,7 +1678,7 @@ void DebuggerPluginPrivate::attachToRunningApplication()
rp.setStartMode(AttachToRemoteProcess);
rp.setCloseMode(DetachAtClose);
rp.setUseContinueInsteadOfRun(true);
debugger->setContinueAfterAttach(false);
rp.setContinueAfterAttach(false);
runControl->start();
}
@@ -1747,7 +1747,7 @@ RunControl *DebuggerPluginPrivate::attachToRunningProcess(Kit *kit,
rp.setInferiorExecutable(device->filePath(processInfo.executable));
rp.setStartMode(AttachToLocalProcess);
rp.setCloseMode(DetachAtClose);
debugger->setContinueAfterAttach(contAfterAttach);
rp.setContinueAfterAttach(contAfterAttach);
runControl->start();

View File

@@ -108,11 +108,6 @@ void DebuggerRunTool::setSysRoot(const Utils::FilePath &sysRoot)
m_runParameters.sysRoot = sysRoot;
}
void DebuggerRunTool::setContinueAfterAttach(bool on)
{
m_runParameters.continueAfterAttach = on;
}
void DebuggerRunTool::setBreakOnMain(bool on)
{
m_runParameters.breakOnMain = on;

View File

@@ -35,7 +35,6 @@ public:
void setSysRoot(const Utils::FilePath &sysRoot);
void setContinueAfterAttach(bool on);
void setBreakOnMain(bool on);
void setUseTerminal(bool on);
void setUseDebugServer(Utils::ProcessHandle attachPid, bool essential, bool useMulti);

View File

@@ -4674,7 +4674,7 @@ void GdbEngine::handleLocalAttach(const DebuggerResponse &response)
// receiving its '^done'.
claimInitialBreakpoints();
notifyEngineRunAndInferiorStopOk();
if (runParameters().continueAfterAttach)
if (runParameters().continueAfterAttach())
continueInferiorInternal();
else
updateAll();

View File

@@ -314,7 +314,7 @@ void LldbEngine::handleLldbStarted()
|| rp.startMode() == AttachToRemoteServer)
? rp.remoteChannel() : QString()));
QTC_CHECK(
!rp.continueAfterAttach
!rp.continueAfterAttach()
|| (rp.startMode() == AttachToRemoteProcess || rp.startMode() == AttachToLocalProcess
|| rp.startMode() == AttachToRemoteServer || rp.startMode() == AttachToIosDevice));
m_continueAtNextSpontaneousStop = false;
@@ -924,7 +924,7 @@ void LldbEngine::handleStateNotification(const GdbMi &item)
} else if (newState == "enginerunfailed")
notifyEngineRunFailed();
else if (newState == "enginerunandinferiorrunok") {
if (runParameters().continueAfterAttach)
if (runParameters().continueAfterAttach())
m_continueAtNextSpontaneousStop = true;
notifyEngineRunAndInferiorRunOk();
} else if (newState == "enginerunandinferiorstopok") {

View File

@@ -949,7 +949,7 @@ void IosDebugSupport::start()
const IosDeviceTypeAspect::Data *data = runControl()->aspectData<IosDeviceTypeAspect>();
QTC_ASSERT(data, reportFailure("Broken IosDeviceTypeAspect setup."); return);
rp.setDisplayName(data->applicationName);
setContinueAfterAttach(true);
rp.setContinueAfterAttach(true);
IosDevice::ConstPtr dev = std::dynamic_pointer_cast<const IosDevice>(device());
if (dev->type() == Ios::Constants::IOS_DEVICE_TYPE

View File

@@ -162,7 +162,7 @@ private:
if (isCppDebugging()) {
rp.setUseExtendedRemote(false);
rp.setUseContinueInsteadOfRun(true);
setContinueAfterAttach(true);
rp.setContinueAfterAttach(true);
rp.setRemoteChannel(runControl()->debugChannel());
rp.setSymbolFile(symbolFile);

View File

@@ -1607,7 +1607,7 @@ void HeobData::processFinished()
rp.setDisplayName(Tr::tr("Process %1").arg(m_data[1]));
rp.setStartMode(AttachToLocalProcess);
rp.setCloseMode(DetachAtClose);
debugger->setContinueAfterAttach(true);
rp.setContinueAfterAttach(true);
rp.setInferiorExecutable(FilePath::fromString(Utils::imageName(m_data[1])));
connect(m_runControl, &RunControl::started, this, &HeobData::debugStarted);