我已经从命令行启动了LLDB调试器,目标是独立的C可执行文件,并设置了
main()
方法作为断点。
在调试器中运行应用程序后,我看到它停止在汇编行,而不是C代码行。此外,每次我前进时,步骤分辨率都是一条流水线。
下面是lldb的输出:
(lldb) target create "./a.out"
Current executable set to './a.out' (x86_64).
(lldb) breakpoint set
Breakpoint 1: where = a.out`main, address = 0x0000000100000e80
(lldb) run
Process 2023 launched: './a.out' (x86_64)
Process 2023 stopped
* thread #1: tid = 0xfca5, 0x0000000100000e80 a.out`main, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x0000000100000e80 a.out`main a.out`main:
-> 0x100000e80 <+0>: pushq %rbp
0x100000e81 <+1>: movq %rsp, %rbp
0x100000e84 <+4>: pushq %r15
0x100000e86 <+6>: pushq %r14
(lldb) n
Process 2023 stopped
* thread #1: tid = 0xfca5, 0x0000000100000e81 a.out`main + 1, queue = 'com.apple.main-thread', stop reason = instruction step over
frame #0: 0x0000000100000e81 a.out`main + 1
a.out`main:
-> 0x100000e81 <+1>: movq %rsp, %rbp
0x100000e84 <+4>: pushq %r15
0x100000e86 <+6>: pushq %r14
0x100000e88 <+8>: pushq %r12
(lldb) n
有没有任何方法可以更改单个C源代码行而不是装配线的步骤分辨率(就像我从Xcode运行lldb时得到的那样)?