diff --git a/src/plugins/boot2qt/qdbdevicedebugsupport.cpp b/src/plugins/boot2qt/qdbdevicedebugsupport.cpp index 6e561721225..f5357283778 100644 --- a/src/plugins/boot2qt/qdbdevicedebugsupport.cpp +++ b/src/plugins/boot2qt/qdbdevicedebugsupport.cpp @@ -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); diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index a461b6edff1..a504bc9860f 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -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 { diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 16b5ab53a76..6fbb23579aa 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -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(); diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 67f60aa35e6..5577e101f8e 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -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; diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h index efc12a6c023..bcf3a541ad8 100644 --- a/src/plugins/debugger/debuggerruncontrol.h +++ b/src/plugins/debugger/debuggerruncontrol.h @@ -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); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index f6cf4d0b2d3..e35f64cc773 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -4674,7 +4674,7 @@ void GdbEngine::handleLocalAttach(const DebuggerResponse &response) // receiving its '^done'. claimInitialBreakpoints(); notifyEngineRunAndInferiorStopOk(); - if (runParameters().continueAfterAttach) + if (runParameters().continueAfterAttach()) continueInferiorInternal(); else updateAll(); diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 1d06ffc1fc2..d99783cd621 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -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") { diff --git a/src/plugins/ios/iosrunner.cpp b/src/plugins/ios/iosrunner.cpp index 3ad904bf11d..d13500c5f8d 100644 --- a/src/plugins/ios/iosrunner.cpp +++ b/src/plugins/ios/iosrunner.cpp @@ -949,7 +949,7 @@ void IosDebugSupport::start() const IosDeviceTypeAspect::Data *data = runControl()->aspectData(); QTC_ASSERT(data, reportFailure("Broken IosDeviceTypeAspect setup."); return); rp.setDisplayName(data->applicationName); - setContinueAfterAttach(true); + rp.setContinueAfterAttach(true); IosDevice::ConstPtr dev = std::dynamic_pointer_cast(device()); if (dev->type() == Ios::Constants::IOS_DEVICE_TYPE diff --git a/src/plugins/qtapplicationmanager/appmanagerruncontrol.cpp b/src/plugins/qtapplicationmanager/appmanagerruncontrol.cpp index d7260e8543b..c483a15fd87 100644 --- a/src/plugins/qtapplicationmanager/appmanagerruncontrol.cpp +++ b/src/plugins/qtapplicationmanager/appmanagerruncontrol.cpp @@ -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); diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index c86f1ef98df..17de19d3445 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -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);