Debugger: Fix remote debugging macosx apps

Change-Id: I5328069ba9b82bb66dfa2c1e0d148a717d594a4b
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-06-21 16:38:41 +02:00
parent 26ef870761
commit 31c6ff495a
3 changed files with 39 additions and 18 deletions

View File

@@ -1069,9 +1069,13 @@ DebugServerRunner::DebugServerRunner(RunControl *runControl, DebugServerPortsGat
cmd.addArg(QString("*:%1").arg(portsGatherer->gdbServer().port()));
cmd.addArg("--server");
} else if (cmd.executable().baseName() == "debugserver") {
cmd.addArg(QString("*:%1").arg(portsGatherer->gdbServer().port()));
cmd.addArg("--attach");
cmd.addArg(QString::number(m_pid.pid()));
const QString ipAndPort("`echo $SSH_CLIENT | cut -d ' ' -f 1`:%1");
cmd.addArgs(ipAndPort.arg(portsGatherer->gdbServer().port()), CommandLine::Raw);
if (m_pid.isValid())
cmd.addArgs({"--attach", QString::number(m_pid.pid())});
else
cmd.addCommandLineAsArgs(runControl->runnable().command);
} else {
// Something resembling gdbserver
if (m_useMulti)