forked from Imagelibrary/binutils-gdb
[gdb/symtab] Initialize sect_off field of partial_symtab
Initialize sect_off field of partial_tab using the sect_offset of the top-level DIE of the partial_symbol.
This commit is contained in:
@@ -7813,6 +7813,16 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
|
|||||||
partial_symbol psymbol;
|
partial_symbol psymbol;
|
||||||
memset (&psymbol, 0, sizeof (psymbol));
|
memset (&psymbol, 0, sizeof (psymbol));
|
||||||
psymbol.ginfo.set_language (cu->language, &objfile->objfile_obstack);
|
psymbol.ginfo.set_language (cu->language, &objfile->objfile_obstack);
|
||||||
|
sect_offset sect_off = sect_offset (0);
|
||||||
|
if (lazy_expand_symtab_p)
|
||||||
|
{
|
||||||
|
struct partial_die_info *top_level = pdi;
|
||||||
|
while (top_level->die_parent != nullptr
|
||||||
|
&& top_level->die_parent->tag != DW_TAG_compile_unit
|
||||||
|
&& top_level->die_parent->tag != DW_TAG_partial_unit)
|
||||||
|
top_level = top_level->die_parent;
|
||||||
|
sect_off = top_level->sect_off;
|
||||||
|
}
|
||||||
psymbol.ginfo.set_section_index (-1);
|
psymbol.ginfo.set_section_index (-1);
|
||||||
|
|
||||||
/* The code below indicates that the psymbol should be installed by
|
/* The code below indicates that the psymbol should be installed by
|
||||||
@@ -7980,7 +7990,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
|
|||||||
}
|
}
|
||||||
cu->per_cu->v.psymtab->add_psymbol
|
cu->per_cu->v.psymtab->add_psymbol
|
||||||
(psymbol, *where, per_objfile->per_bfd->partial_symtabs.get (),
|
(psymbol, *where, per_objfile->per_bfd->partial_symtabs.get (),
|
||||||
objfile);
|
objfile, sect_off);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ struct partial_symtab
|
|||||||
void add_psymbol (const partial_symbol &psym,
|
void add_psymbol (const partial_symbol &psym,
|
||||||
psymbol_placement where,
|
psymbol_placement where,
|
||||||
psymtab_storage *partial_symtabs,
|
psymtab_storage *partial_symtabs,
|
||||||
struct objfile *objfile);
|
struct objfile *objfile, sect_offset sect_off = sect_offset (0));
|
||||||
|
|
||||||
|
|
||||||
/* Indicate that this partial symtab is complete. */
|
/* Indicate that this partial symtab is complete. */
|
||||||
|
|||||||
@@ -1335,7 +1335,7 @@ void
|
|||||||
partial_symtab::add_psymbol (const partial_symbol &psymbol,
|
partial_symtab::add_psymbol (const partial_symbol &psymbol,
|
||||||
psymbol_placement where,
|
psymbol_placement where,
|
||||||
psymtab_storage *partial_symtabs,
|
psymtab_storage *partial_symtabs,
|
||||||
struct objfile *objfile)
|
struct objfile *objfile, sect_offset sect_off)
|
||||||
{
|
{
|
||||||
bool added;
|
bool added;
|
||||||
|
|
||||||
@@ -1355,6 +1355,9 @@ partial_symtab::add_psymbol (const partial_symbol &psymbol,
|
|||||||
? static_psymbols
|
? static_psymbols
|
||||||
: global_psymbols);
|
: global_psymbols);
|
||||||
list.push_back (psym);
|
list.push_back (psym);
|
||||||
|
|
||||||
|
if (to_underlying (sect_off) != 0)
|
||||||
|
this->sect_off.emplace (psym, sect_off);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See psympriv.h. */
|
/* See psympriv.h. */
|
||||||
|
|||||||
Reference in New Issue
Block a user