static libraries - Why doesn't GDB recognize my library's symbols? -
i have project hierarchy similar following:
src/ code.c ext/ lib/ lib.c lib.a bin/ bin-code (+x) obj/ code.o
lib.c
compileslib.a
using-g2
flag ,ar
.code.c
compilesbin/obj/code.o
using-g2
flag.lib.a
,code.o
linked binarybin-code
.
i'm facing bug within bin-code
, i'm trying use gdb load symbols/source lib
can examine tui.
i'm adding breakpoint function inside lib.c
, seems find echos out address , says set breakpoint.
when run program , hit breakpoint, open tui ctrlx / ctrla, claims no source found.
two things worth mentioning:
- i have used
set substitute-path
due fact build system (tup) uses fuse filesystem enforce read/write operations. - i have tried adding
directory
entries search paths, no avail.
am missing here? there command can issue gdb in order rescan directories or something? can't library's source show up, though appears symbols have been loaded.
most gdb fails find sources of static library , can't show it's source code.
this may happen if binary moved machine after built or sources moved directory. in case should set substitute-path
. can see gdb tries find sources of static library (lib.c
) using info sources
command. compare path 1 lib.c
located , should set proper path substitution.
Comments
Post a Comment