This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Fix minsym lookup with .gnu_debuglink
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sourceware dot org
- Date: Tue, 18 Dec 2007 11:06:41 -0500
- Subject: [commit] Fix minsym lookup with .gnu_debuglink
MontaVista noticed that GDB was continuing past "main" in backtraces
for their system binaries. This happened because they use separate
debug objfiles for all installed binaries, not just libraries. GDB
did not realize that the symbol "main" in
symbol_objfile->separate_debug_objfile was part of the main symbol file.
I've checked in the obvious fix, as below. Tested on x86_64-linux
with no regressions.
--
Daniel Jacobowitz
CodeSourcery
2007-12-18 Daniel Jacobowitz <dan@codesourcery.com>
* minsyms.c (lookup_minimal_symbol): Also check the separate
debug objfile.
(lookup_minimal_symbol_text): Likewise.
(lookup_minimal_symbol_solib_trampoline): Likewise.
* symtab.c (lookup_global_symbol_from_objfile): Likewise.
Index: minsyms.c
===================================================================
RCS file: /cvs/src/src/gdb/minsyms.c,v
retrieving revision 1.53
diff -u -p -r1.53 minsyms.c
--- minsyms.c 19 Oct 2007 12:26:34 -0000 1.53
+++ minsyms.c 18 Dec 2007 15:24:51 -0000
@@ -176,7 +176,8 @@ lookup_minimal_symbol (const char *name,
objfile != NULL && found_symbol == NULL;
objfile = objfile->next)
{
- if (objf == NULL || objf == objfile)
+ if (objf == NULL || objf == objfile
+ || objf->separate_debug_objfile == objfile)
{
/* Do two passes: the first over the ordinary hash table,
and the second over the demangled hash table. */
@@ -274,7 +275,8 @@ lookup_minimal_symbol_text (const char *
objfile != NULL && found_symbol == NULL;
objfile = objfile->next)
{
- if (objf == NULL || objf == objfile)
+ if (objf == NULL || objf == objfile
+ || objf->separate_debug_objfile == objfile)
{
for (msymbol = objfile->msymbol_hash[hash];
msymbol != NULL && found_symbol == NULL;
@@ -330,7 +332,8 @@ lookup_minimal_symbol_solib_trampoline (
objfile != NULL && found_symbol == NULL;
objfile = objfile->next)
{
- if (objf == NULL || objf == objfile)
+ if (objf == NULL || objf == objfile
+ || objf->separate_debug_objfile == objfile)
{
for (msymbol = objfile->msymbol_hash[hash];
msymbol != NULL && found_symbol == NULL;
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.167
diff -u -p -r1.167 symtab.c
--- symtab.c 24 Oct 2007 13:25:16 -0000 1.167
+++ symtab.c 18 Dec 2007 15:24:52 -0000
@@ -1363,6 +1363,11 @@ lookup_global_symbol_from_objfile (const
}
}
+ if (objfile->separate_debug_objfile)
+ return lookup_global_symbol_from_objfile (objfile->separate_debug_objfile,
+ name, linkage_name, domain,
+ symtab);
+
return NULL;
}