From 1791db4e96ccb57842b888649965e7583b601fbe Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 20 Nov 2024 14:06:02 +0100 Subject: [PATCH] Debugger: Inline RemoteAttachRunner Task-number: QTCREATORBUG-29168 Change-Id: Ie346d7f4d9d02fd7cbf80d3ec05ffad5fa268fe3 Reviewed-by: hjk --- src/plugins/debugger/debuggerplugin.cpp | 29 ++++++++----------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index f91c392f4c7..af452f8bf94 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1708,25 +1708,6 @@ void DebuggerPluginPrivate::startRemoteCdbSession() debugger->startRunControl(); } -class RemoteAttachRunner : public DebuggerRunTool -{ -public: - RemoteAttachRunner(RunControl *runControl, ProcessHandle pid) - : DebuggerRunTool(runControl) - { - setId("AttachToRunningProcess"); - setUsePortsGatherer(true, false); - setUseDebugServer(pid, false, false); - - setStartMode(AttachToRemoteProcess); - setCloseMode(DetachAtClose); - - // setInferiorExecutable(localExecutable); - setUseContinueInsteadOfRun(true); - setContinueAfterAttach(false); - } -}; - void DebuggerPluginPrivate::attachToRunningApplication() { auto kitChooser = new KitChooser; @@ -1755,7 +1736,15 @@ void DebuggerPluginPrivate::attachToRunningApplication() runControl->setKit(kit); //: %1: PID runControl->setDisplayName(Tr::tr("Process %1").arg(processInfo.processId)); - auto debugger = new RemoteAttachRunner(runControl, ProcessHandle(processInfo.processId)); + runControl->requestDebugChannel(); + + auto debugger = new DebuggerRunTool(runControl); + debugger->setId("AttachToRunningProcess"); + debugger->setUseDebugServer(ProcessHandle(processInfo.processId), false, false); + debugger->setStartMode(AttachToRemoteProcess); + debugger->setCloseMode(DetachAtClose); + debugger->setUseContinueInsteadOfRun(true); + debugger->setContinueAfterAttach(false); debugger->startRunControl(); } }