From 64c13b44dabf4af9b10a54079aa89a702421668e Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Thu, 21 Nov 2024 10:01:54 +0100 Subject: [PATCH] Boot2Qt: Inline QdbDeviceDebugSupport Task-number: QTCREATORBUG-29168 Change-Id: I94432f6b54c05c763ea5c16f3bfc278a995a3ce5 Reviewed-by: hjk --- src/plugins/boot2qt/qdbdevicedebugsupport.cpp | 55 ++++++------------- 1 file changed, 17 insertions(+), 38 deletions(-) diff --git a/src/plugins/boot2qt/qdbdevicedebugsupport.cpp b/src/plugins/boot2qt/qdbdevicedebugsupport.cpp index c9032a4922a..5018b45d2fb 100644 --- a/src/plugins/boot2qt/qdbdevicedebugsupport.cpp +++ b/src/plugins/boot2qt/qdbdevicedebugsupport.cpp @@ -84,43 +84,6 @@ static RunWorker *createQdbDeviceInferiorWorker(RunControl *runControl, return worker; } -// QdbDeviceDebugSupport - -class QdbDeviceDebugSupport final : public Debugger::DebuggerRunTool -{ -public: - explicit QdbDeviceDebugSupport(RunControl *runControl); - -private: - void start() override; -}; - -QdbDeviceDebugSupport::QdbDeviceDebugSupport(RunControl *runControl) - : Debugger::DebuggerRunTool(runControl) -{ - setId("QdbDeviceDebugSupport"); - - if (isCppDebugging()) - runControl->requestDebugChannel(); - if (isQmlDebugging()) - runControl->requestQmlChannel(); - - auto debuggee = createQdbDeviceInferiorWorker(runControl, QmlDebuggerServices); - addStartDependency(debuggee); - - debuggee->addStopDependency(this); -} - -void QdbDeviceDebugSupport::start() -{ - setStartMode(Debugger::AttachToRemoteServer); - setCloseMode(KillAndExitMonitorAtClose); - setUseContinueInsteadOfRun(true); - setContinueAfterAttach(true); - addSolibSearchDir("%{sysroot}/system/lib"); - DebuggerRunTool::start(); -} - class QdbRunWorkerFactory final : public RunWorkerFactory { public: @@ -150,7 +113,23 @@ class QdbDebugWorkerFactory final : public RunWorkerFactory public: QdbDebugWorkerFactory() { - setProduct(); + setProducer([](RunControl *runControl) { + auto worker = new DebuggerRunTool(runControl); + worker->setId("QdbDeviceDebugSupport"); + + worker->setupPortsGatherer(); + worker->setStartMode(Debugger::AttachToRemoteServer); + worker->setCloseMode(KillAndExitMonitorAtClose); + worker->setUseContinueInsteadOfRun(true); + worker->setContinueAfterAttach(true); + worker->addSolibSearchDir("%{sysroot}/system/lib"); + + auto debuggee = createQdbDeviceInferiorWorker(runControl, QmlDebuggerServices); + worker->addStartDependency(debuggee); + debuggee->addStopDependency(worker); + + return worker; + }); addSupportedRunMode(ProjectExplorer::Constants::DEBUG_RUN_MODE); addSupportedRunConfig(Constants::QdbRunConfigurationId); addSupportedRunConfig(QmlProjectManager::Constants::QML_RUNCONFIG_ID);