Debugger: Support linux remote debugging with LLDB

Adds support for Linux remote debugging with lldb-server

Change-Id: I3ee08704a3116030111df75273a46a2e4888f98e
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-06-23 09:14:05 +02:00
committed by hjk
parent fd83aa0bf7
commit 77edffe3cf
3 changed files with 56 additions and 12 deletions

View File

@@ -1068,7 +1068,26 @@ DebugServerRunner::DebugServerRunner(RunControl *runControl, DebugServerPortsGat
cmd.setExecutable(lldbserver);
}
} else {
cmd.setExecutable(runControl->device()->filePath("gdbserver"));
const FilePath gdbServerPath
= runControl->device()->filePath("gdbserver").searchInPath();
FilePath lldbServerPath
= runControl->device()->filePath("lldb-server").searchInPath();
// TODO: Which one should we prefer?
if (gdbServerPath.isExecutableFile())
cmd.setExecutable(gdbServerPath);
else if (lldbServerPath.isExecutableFile()) {
// lldb-server will fail if we start it through a link.
// see: https://github.com/llvm/llvm-project/issues/61955
//
// So we first search for the real executable.
// This is safe because we already checked that the file is executable.
while (lldbServerPath.isSymLink())
lldbServerPath = lldbServerPath.symLinkTarget();
cmd.setExecutable(lldbServerPath);
}
}
}
if (cmd.executable().baseName().contains("lldb-server")) {