views:

416

answers:

2

I'm working on getting set with Eclipse CDT for some embedded development and I'm having difficulty getting source level debugging working for static libraries.

I'm using my own Makefiles, so that is my first suspect right now, especially since gdb claims that no symbol table info is available for the functions with no source. When using a static library, is the debugging information from the library usually included in the ELF file from the final link stage? Right now I can see the full source/assembly mix if I point objdump -S at the .a file, but none of the debug info makes it into the .elf. The debugging info/source is present for the main application. Am I missing some switch to tell ld to include this?

Otherwise, what is the best way to get gdb to tell me what is looking for (and failing to find) with regard to debug information for a specific function.

A: 

I would guess that GDB is simply not finding the source files that go with that debug information. See http://web.mit.edu/gnu/doc/html/gdb%5F9.html#SEC51 for documentation on how to tell it where to find source files.

Brooks Moses
If you read the last part of the question, I'm aware of this. The problem is figuring out what gdb is looking for, since it knows about the directories already. Obviously something else is going on.
megabytephreak
Ah, okay, yeah. When you say "none of that debug info makes it into the .elf", how are you testing that?
Brooks Moses
+2  A: 

Figured it out.

The lesson is very simple: always, always, triple check your makefiles. Was still linking in an old copy of the static library built without debugging information.

megabytephreak
Hah! Yeah, that would do it. :D
Brooks Moses
Oh, and you should probably mark that answer as "accepted" so's people don't keep trying to figure out the problem for you.
Brooks Moses