diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-10-09 18:37:27 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-10-09 18:37:27 +0000 |
commit | 741f5e3c63f81da03e3c73b09c0205c3bcac0658 (patch) | |
tree | 3ad292810ad0114f7a9d4720cf2a40e21cafa0e6 /gdb/dwarf2read.c | |
parent | a73d2258a7f0bd52aa9a4df764109c9df7f02e26 (diff) | |
download | fsf-binutils-gdb-741f5e3c63f81da03e3c73b09c0205c3bcac0658.zip fsf-binutils-gdb-741f5e3c63f81da03e3c73b09c0205c3bcac0658.tar.gz fsf-binutils-gdb-741f5e3c63f81da03e3c73b09c0205c3bcac0658.tar.bz2 |
gdb/
Fix initial language detection with -readnow.
* dwarf2read.c (dw2_find_symbol_file): Handle OBJF_READNOW case.
* symfile.h (struct quick_symbol_functions): State find_symbol_file
searches only for global symbols.
gdb/testsuite/
Fix initial language detection with -readnow.
* gdb.cp/readnow-language.cc: New file.
* gdb.cp/readnow-language.exp: New file.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 55abb93..be7a7ef 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -2650,7 +2650,21 @@ dw2_find_symbol_file (struct objfile *objfile, const char *name) /* index_table is NULL if OBJF_READNOW. */ if (!dwarf2_per_objfile->index_table) - return NULL; + { + struct symtab *s; + + ALL_OBJFILE_SYMTABS (objfile, s) + if (s->primary) + { + struct blockvector *bv = BLOCKVECTOR (s); + const struct block *block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); + struct symbol *sym = lookup_block_symbol (block, name, VAR_DOMAIN); + + if (sym) + return sym->symtab->filename; + } + return NULL; + } if (!find_slot_in_mapped_hash (dwarf2_per_objfile->index_table, name, &vec)) |