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.
This commit is contained in:
Jan Kratochvil
2011-10-09 18:37:27 +00:00
parent a73d2258a7
commit 741f5e3c63
6 changed files with 78 additions and 2 deletions

View File

@ -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))