aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2010-01-06 10:11:04 +0000
committerTristan Gingold <gingold@adacore.com>2010-01-06 10:11:04 +0000
commit15d123c99f48b4b4620d87a0e9ee124de1a0659f (patch)
tree5587ecb3e8a4b88fe4d4a5f7aaac474728405d4d /gdb/symtab.c
parentd2ca6b5b4227727844a9ba907ac40038504b4476 (diff)
downloadfsf-binutils-gdb-15d123c99f48b4b4620d87a0e9ee124de1a0659f.zip
fsf-binutils-gdb-15d123c99f48b4b4620d87a0e9ee124de1a0659f.tar.gz
fsf-binutils-gdb-15d123c99f48b4b4620d87a0e9ee124de1a0659f.tar.bz2
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.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c66
1 files changed, 34 insertions, 32 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index d7b8145..7f5dabd 100644
--- a/gdb/symtab.c
+++ b/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);
- }
- }
-
- /* 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);
+ 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);
+ }
+ }
+ }
return NULL;
}