Debugger: Inline RemoteAttachRunner

Task-number: QTCREATORBUG-29168
Change-Id: Ie346d7f4d9d02fd7cbf80d3ec05ffad5fa268fe3
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2024-11-20 14:06:02 +01:00
parent 431c501c2c
commit 1791db4e96

View File

@@ -1708,25 +1708,6 @@ void DebuggerPluginPrivate::startRemoteCdbSession()
debugger->startRunControl(); 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() void DebuggerPluginPrivate::attachToRunningApplication()
{ {
auto kitChooser = new KitChooser; auto kitChooser = new KitChooser;
@@ -1755,7 +1736,15 @@ void DebuggerPluginPrivate::attachToRunningApplication()
runControl->setKit(kit); runControl->setKit(kit);
//: %1: PID //: %1: PID
runControl->setDisplayName(Tr::tr("Process %1").arg(processInfo.processId)); 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(); debugger->startRunControl();
} }
} }