使用 LLDB 远程启动进程

Remotely launching a process with LLDB

我正在尝试使用 lldb 远程启动和调试新进程,但没有成功。

通过 运行 执行以下命令可以很好地附加到已启动的进程:

process connect <url>
process attach -P gdb-remote --pid <pid>

但是,如果我希望 debugserver 自行启动可执行文件,我 运行 就会遇到麻烦。特别是,我不知道我应该传递什么参数给 target create.

根据 this page LLDB "will transparently take care of [..] downloading the executable in order to be able to debug",但 target create 似乎总是需要本地文件。如果我通过 -r 指定远程文件,我会收到 unable to open target fileremote --> local transfer without local path is not implemented yet 错误。如果我在不使用 -r 的情况下将目标设置为本地文件(例如远程加载程序可执行文件的本地副本),则尝试 运行 process launch -p gdb-remote -s <remote path> LLDB 将尝试 运行在远程计算机上设置本地路径并失败。

为了启动远程进程,我需要使用哪些正确的命令?

联系 LLDB 的邮件列表 Greg 后更新了 the documentation page,现在清楚地解释了我必须做什么(特别是我错过了 script 行,这似乎是设置远程可执行路径)