Let's say I have a .c
file on my Macbook ~/github/leetcode/c/src/hello.c
.
After compile with cc -g
command, I have a binary file at ~/github/leetcode/c/bin/hello.o
Now I want to use LLDB to debug,
lldb ~/github/leetcode/c/bin/hello.o
it works,
(lldb) target create "/Users/Wei/github/leetcode/c/bin/DifferentWaysToAddParentheses.o"
Current executable set to '/Users/Wei/github/leetcode/c/bin/DifferentWaysToAddParentheses.o' (x86_64).
but when I try to add a break point,
breakpoint set --file "~/github/leetcode/c/src/DifferentWaysToAddParentheses.c" --line 10
it seems that the .c
file can not be found,
Breakpoint 1: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
but, when I simply use the file name without the path,
breakpoint set --file DifferentWaysToAddParentheses.c --line 10
now it works,
Breakpoint 2: where = DifferentWaysToAddParentheses.o`main + 44 at DifferentWaysToAddParentheses.c:10, address = 0x0000000100000dec
It really confused me! Why LLDB can not work with the path? The second question is, how can LLDB find the file without the path? Thx!