LLDB Error: Unable to resolve breakpoint to any actual locations

后端 未结 1 1915
花落未央
花落未央 2020-12-31 05:22

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         


        
1条回答
  •  生来不讨喜
    2020-12-31 05:42

    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.

    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
    

    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 Generate debug information. Note that Clang debug information works best at -O0.

    0 讨论(0)
提交回复
热议问题