2010-01-06 Tristan Gingold <gingold@adacore.com>
* symtab.c (lookup_global_symbol_from_objfile): Rename objfile parameter to main_objfile. Iterate on all separate debug objfiles. * symfile.h (symbol_file_add_separate) (find_separate_debug_file_by_debuglink): Remove parameter names. * symfile.c (symbol_file_add_separate): Use add_separate_objfile. (reread_symbols): Use free_objfile_separate_debug. * objfiles.h (struct objfile): Add separate_debug_objfile_link. Adjust comment. (objfile_separate_debug_iterate, add_separate_debug_objfile) (free_objfile_separate_debug): New prototypes. * objfiles.c (objfile_separate_debug_iterate): New function. (add_separate_debug_objfile, free_objfile_separate_debug): New functions. (free_objfile): Use free_objfile_separate_debug. Adjust for multiple separate debug objfile. (objfile_has_symbols): Adjust comment. Iterate on all separate debug objfiles. * minsyms.c (lookup_minimal_symbol): Adjust for multiple separate debug objfile. (lookup_minimal_symbol_text): Ditto. (lookup_minimal_symbol_by_pc_name): Ditto. (lookup_minimal_symbol_solib_trampoline): Ditto. (lookup_minimal_symbol_by_pc_section_1): Iterate on all separate debug objfiles.
This commit is contained in:
parent
d2ca6b5b42
commit
15d123c99f
7 changed files with 199 additions and 82 deletions
64
gdb/symtab.c
64
gdb/symtab.c
|
@ -1499,48 +1499,50 @@ lookup_symbol_aux_block (const char *name, const char *linkage_name,
|
|||
psymtabs. */
|
||||
|
||||
struct symbol *
|
||||
lookup_global_symbol_from_objfile (const struct objfile *objfile,
|
||||
lookup_global_symbol_from_objfile (const struct objfile *main_objfile,
|
||||
const char *name,
|
||||
const char *linkage_name,
|
||||
const domain_enum domain)
|
||||
{
|
||||
const struct objfile *objfile;
|
||||
struct symbol *sym;
|
||||
struct blockvector *bv;
|
||||
const struct block *block;
|
||||
struct symtab *s;
|
||||
struct partial_symtab *ps;
|
||||
|
||||
/* Go through symtabs. */
|
||||
ALL_OBJFILE_SYMTABS (objfile, s)
|
||||
{
|
||||
bv = BLOCKVECTOR (s);
|
||||
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
|
||||
sym = lookup_block_symbol (block, name, linkage_name, domain);
|
||||
if (sym)
|
||||
{
|
||||
block_found = block;
|
||||
return fixup_symbol_section (sym, (struct objfile *)objfile);
|
||||
}
|
||||
}
|
||||
for (objfile = main_objfile;
|
||||
objfile;
|
||||
objfile = objfile_separate_debug_iterate (main_objfile, objfile))
|
||||
{
|
||||
/* Go through symtabs. */
|
||||
ALL_OBJFILE_SYMTABS (objfile, s)
|
||||
{
|
||||
bv = BLOCKVECTOR (s);
|
||||
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
|
||||
sym = lookup_block_symbol (block, name, linkage_name, domain);
|
||||
if (sym)
|
||||
{
|
||||
block_found = block;
|
||||
return fixup_symbol_section (sym, (struct objfile *)objfile);
|
||||
}
|
||||
}
|
||||
|
||||
/* Now go through psymtabs. */
|
||||
ALL_OBJFILE_PSYMTABS (objfile, ps)
|
||||
{
|
||||
if (!ps->readin
|
||||
&& lookup_partial_symbol (ps, name, linkage_name,
|
||||
1, domain))
|
||||
{
|
||||
s = PSYMTAB_TO_SYMTAB (ps);
|
||||
bv = BLOCKVECTOR (s);
|
||||
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
|
||||
sym = lookup_block_symbol (block, name, linkage_name, domain);
|
||||
return fixup_symbol_section (sym, (struct objfile *)objfile);
|
||||
}
|
||||
}
|
||||
|
||||
if (objfile->separate_debug_objfile)
|
||||
return lookup_global_symbol_from_objfile (objfile->separate_debug_objfile,
|
||||
name, linkage_name, domain);
|
||||
/* Now go through psymtabs. */
|
||||
ALL_OBJFILE_PSYMTABS (objfile, ps)
|
||||
{
|
||||
if (!ps->readin
|
||||
&& lookup_partial_symbol (ps, name, linkage_name,
|
||||
1, domain))
|
||||
{
|
||||
s = PSYMTAB_TO_SYMTAB (ps);
|
||||
bv = BLOCKVECTOR (s);
|
||||
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
|
||||
sym = lookup_block_symbol (block, name, linkage_name, domain);
|
||||
return fixup_symbol_section (sym, (struct objfile *)objfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue