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 compiles lib.a using -g2 flag , ar.
  • code.c compiles bin/obj/code.o using -g2 flag.
  • lib.a , code.o linked binary bin-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:

  1. i have used set substitute-path due fact build system (tup) uses fuse filesystem enforce read/write operations.
  2. 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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -