gdb - Missing line numbers from debug symbols for library in whole program, but not on its own -


i'm seeing odd issue when trying use gdb debug test program package built libtool. if run libtool --mode=execute gdb .libs/libfoo.so , ask list source of function list bar::baz, source code expected. if run libtool --mode=execute gdb binary, can break in bar::baz(), , see arguments in stack trace, no source file or line numbers, so:

#7  0x018348e5 in bar::baz(qux*, quux*) () /path/to/libfoo.so                            ^^^^^^^^^^^ <--- debug symbols present! 

similarly, if try list bar::baz when debugging executable,

no line number known 'bar::baz'. 

i have confirmed binary linked -g, , can list main function, know of debug information present present.

when info sources, full listing of files library built, correct absolute paths. when info shared, correct path listed object file, yes in syms column.

any further ideas going wrong, , how fix it?


edit 1: accident, ran objdump -g on offending library, , got following output:

/path/to/foo.so.0.0.0: file format elf32-i386 objdump: /path/to/foo.so.0.0.0: no recognized debugging information 

this surprising, since objdump -h (what had tried run) lists bunch of .debug_* sections. objdump manual suggests readelf -w well, , seems print huge pile of information. need go through @ provides, though.


edit 2: so, readelf -w has produced enlightenment. whatever reason, shared object file doesn't seem contain debugging information the vast majority any of objects linked it. based on makefiles, it's possible command gathers objects shared library isn't passed -g, , information isn't propagated. funny thing works (has full debug information) on our other configurations, including same compiler version on x86_64 (versus present x86).


edit 3: went through full rebuild modified makefile -g added on ldflags, , made no difference. i'm , baffled.

this answer old question, problem matched mine, none of solutions worked. here worked me.

change cflags -g "-g -gstabs".

objdump not recognizing dwarf style debug information. -gstabs changes format 1 works objdump -g , objdump -s , debugger.

hope helps.

note: me, building linux kernel. change make in linux kernel's makefile.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -