I see a strange problem when trying to use gdb to debug a test program for a package created using libtool. If I run libtool --mode=execute gdb .libs/libfoo.so and ask him to list the source of some list Bar::Baz function, I get the source code as expected. If I run libtool --mode=execute gdb binary , I can break into Bar::Baz() and see its arguments in the stack trace, but I don't get any source files or lines, for example:
Similarly, if I try to list Bar::Baz while debugging the executable, I get
No line number known for 'Bar::Baz'.
I have confirmed that the binary is associated with -g , and I can list its main function, so I know that there is some kind of debugging information.
When I say info sources , I get a complete list of the files the library is built from, with the correct absolute paths. When I say info shared , I get the correct path specified in the object file, with Yes in the Syms column.
Any other ideas what could go wrong and how to fix it?
Edit 1: by chance, I ran objdump -g into the intruder library and received the 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 is surprising since objdump -h (what I was trying to run) contains a list of .debug_* sections. The objdump manual also suggests readelf -w , and this seems to print a huge amount of information. I need to take a look at what it actually provides.
Edit 2: So readelf -w produced some enlightenment. For some reason, the shared object file does not seem to contain debug information from the vast majority of any of the objects associated with it. Based on Make files, it is possible that a command that actually collects objects into a shared library is not passed -g , and therefore the information is not properly distributed. The funny thing is that it works (it has full debugging information) for all our other configurations, including the same x86_64 compiler version (compared to the real x86).
Edit 3: Actually, a complete redistribution went through with a modified Makefile with -g added to LDFLAGS, and that didn't make any difference. Now I am well and really puzzled.