LLDB错误:无法将断点解析为任何实际位置 [英] LLDB Error: Unable to resolve breakpoint to any actual locations
问题描述
我正在尝试使用LLDB(因为我显然再也不能使用gdb了)来调试我的代码,并且每次尝试...
I'm trying to use LLDB (because I apparently can't use gdb anymore) to debug som of my code and each time I try to...
(lldb) breakpoint set -f file.c -l 65
我知道...
Breakpoint 1: no locations (pending)
WARNING: Unable to resolve breakpoint to any actual locations.
我尝试了不同的事情,例如将断点分配给函数之类的东西,但是我总是遇到相同的错误.运行时没有中断.请帮忙!
I've tried different things like assigning the breakpoint to a function and such but I always get the same error. When running there's no break. Please help!
推荐答案
lldb:将断点解析为位置
如果out
文件没有为Code Generation Options
启用调试符号,则断点可能无法解析为.c
源文件中的位置.
lldb: resolving breakpoints to locations
If your out
file doesn't have debugging symbols enabled for Code Generation Options
then breakpoints likely can't be resolved to locations within your .c
source file.
创建out
文件时,请启用调试信息:
When you create your out
file enable debug information:
$ 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
)时,它应该可以解决.
Using the -g
option adds the necessary debug information to your file for lldb
. It should now resolve when you breakpoint set -f file.c -l n
(which can be abbreviated as b file.c:n
).
-g
生成调试信息.请注意,Clang调试信息 在-O0
上效果最好.
-g
Generate debug information. Note that Clang debug information works best at-O0
.
这篇关于LLDB错误:无法将断点解析为任何实际位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!