diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 22a473a403..83f47b2570 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2019-06-18 Tom de Vries + + PR gdb/24515 + * dwarf2read.h (abstract_to_concrete): Change type from + std::unordered_map> to + std::unordered_map>. + * dwarf2read.c (read_variable): Update. + (dwarf2_fetch_die_loc_sect_off): Update. + 2019-06-17 Tom de Vries PR gdb/24617 diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index a51ae49e87..9cf513b582 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -14288,7 +14288,7 @@ read_variable (struct die_info *die, struct dwarf2_cu *cu) struct die_info *origin_die = follow_die_ref (die, abstract_origin, &origin_cu); dwarf2_per_objfile *dpo = cu->per_cu->dwarf2_per_objfile; - dpo->abstract_to_concrete[origin_die].push_back (die); + dpo->abstract_to_concrete[origin_die->sect_off].push_back (die->sect_off); } } @@ -23256,14 +23256,19 @@ dwarf2_fetch_die_loc_sect_off (sect_offset sect_off, attr = dwarf2_attr (die, DW_AT_location, cu); if (!attr && resolve_abstract_p - && (dwarf2_per_objfile->abstract_to_concrete.find (die) + && (dwarf2_per_objfile->abstract_to_concrete.find (die->sect_off) != dwarf2_per_objfile->abstract_to_concrete.end ())) { CORE_ADDR pc = (*get_frame_pc) (baton); - for (const auto &cand : dwarf2_per_objfile->abstract_to_concrete[die]) + for (const auto &cand_off + : dwarf2_per_objfile->abstract_to_concrete[die->sect_off]) { - if (!cand->parent + struct dwarf2_cu *cand_cu = cu; + struct die_info *cand + = follow_die_offset (cand_off, per_cu->is_dwz, &cand_cu); + if (!cand + || !cand->parent || cand->parent->tag != DW_TAG_subprogram) continue; diff --git a/gdb/dwarf2read.h b/gdb/dwarf2read.h index e8658950e3..776860e454 100644 --- a/gdb/dwarf2read.h +++ b/gdb/dwarf2read.h @@ -256,7 +256,7 @@ public: /* Mapping from abstract origin DIE to concrete DIEs that reference it as DW_AT_abstract_origin. */ - std::unordered_map> + std::unordered_map> abstract_to_concrete; };