我正在尝试使用LLDB(因为我显然再也不能使用gdb了)来调试我的代码,并且每次尝试...
(lldb) breakpoint set -f file.c -l 65
我知道了
Breakpoint 1: no locations (pending)
WARNING: Unable to resolve breakpoint to any actual locations.
我尝试了不同的事情,例如将断点分配给函数之类,但是我总是遇到相同的错误。运行时没有中断。请帮忙!
最佳答案
lldb:解决断点到位置
如果您的out
文件没有为Code Generation Options
启用调试符号,则断点可能无法解析为.c
源文件中的位置。
创建out
文件时,请启用调试信息:
$ clang -g -O0 file.c -o file
$ lldb file
(lldb) target create "file"
Current executable set to 'file' (x86_64).
(lldb) b file.c:13
Breakpoint 1: where = file`main + 29 at file.c:13, address = 0x0000000100000f4d
使用
-g
选项将必要的调试信息添加到文件中的lldb
。现在,您在breakpoint set -f file.c -l n
时可以解析(可以缩写为b file.c:n
)。-g
生成调试信息。请注意,Clang调试信息在
-O0
上效果最好。
关于macos - LLDB错误:无法将断点解析为任何实际位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31122871/