mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-28 07:08:01 +08:00
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.
This commit is contained in:
@ -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))
|
||||
|
Reference in New Issue
Block a user