我已经提取了 debugserver
并将其复制到我越狱的 iPhone 5S 上。然后我在我的 mac 上运行 LLDB 并使用说明连接它 here .
我使用 SSH/SFTP 复制了一个用 C 语言编写并为 ARM64 编译的简单的 hello world 程序到我的 iPhone 5S 上,并对其进行了 chmod。
我使用了命令:./debugserver *:1234 helloworld64_full
其中 helloworld64_full 是设备上的可执行文件。
然后我开始连接到 iPhone:platform select remote-ios
和 process connect connect://localhost:1234
停止在:
Process 442 stopped
* thread #1: tid = 0x90ed, 0x0000000120085010 dyld`_dyld_start, stop reason = signal SIGSTOP
frame #0: 0x0000000120085010 dyld`_dyld_start
dyld`_dyld_start:
-> 0x120085010: add x28, sp, 0
0x120085014: and sp, x28, #0xfffffffffffffff0
0x120085018: movz x0, #0
0x12008501c: movz x1, #0
(lldb) b main
然而,当我开始设置断点时 b main
。它说:
Breakpoint 1: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
但是当我为 x86-64 重新编译相同的源程序并在我的 mac 上调试时,我可以设置断点。为什么会这样?请指教谢谢。
最佳答案
好的,我通过像这样在 lldb 客户端上实际包含文件来获得它:
target create --arch arm64 helloworld_full
基本上我忘记了要调试的可执行文件的相同副本必须加载到客户端(也就是 mac 机器)
关于ios - Hello world 命令行 LLDB iOS 无法解析 'main' 中的断点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22685319/