This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Interesting dwarf-2/shared lib problem.
- From: "Kris Warkentin" <kewarken at qnx dot com>
- To: "Gdb at Sources dot Redhat dot Com" <gdb at sources dot redhat dot com>
- Date: Tue, 2 Dec 2003 11:13:53 -0500
- Subject: Interesting dwarf-2/shared lib problem.
When debugging an app with a shared lib I ran across the following problem.
After having proceeded to main(), all libs/syms are loaded, source search
directory set appropriately, etc.
Trying to use the following address form:
list display.c:10
-or-
break display.c:27
where display.c is in one of the loaded shared libraries, fails with "No
source file named display.c"
If I then do "break display", where display() is a function in display.c,
the above two addressing forms work fine.
I observed that libdisplay.so has been loaded with a psymtab and that the
code in lookup_symtab() only searches through objects which have a full
symtab loaded. This would seem to be why it's not finding display.c. I'm
supposing that when you do a break on a function, the full symtab is then
loaded.
Note also that this goes away if the source is compiled with the stabs+
debugging format. I'm pondering the solution to this. Is there a way to
force gdb to load the full symbol table for all shared objects? Or is there
a better way to get around this?
cheers,
Kris