From: Tom de Vries Date: Mon, 21 Jun 2021 11:14:05 +0000 (+0200) Subject: [gdb/symtab] Fix problem with enum value X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f7b5068c5f41aa13ee3efa35a2555c3bfafe81f0;p=thirdparty%2Fbinutils-gdb.git [gdb/symtab] Fix problem with enum value When adding a partial symbol for an enum value, we try to find the section offset for the enum itself rather than the enum value. This fails if the parent die is not set. Fix that. --- diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 6c0dc604ad5..e6789666431 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -19022,7 +19022,11 @@ load_partial_dies (const struct die_reader_specs *reader, if (pdi.raw_name == NULL) complaint (_("malformed enumerator DIE ignored")); else if (building_psymtab) - add_partial_symbol (&pdi, cu); + { + if (lazy_expand_symtab_p) + pdi.die_parent = parent_die; + add_partial_symbol (&pdi, cu); + } info_ptr = locate_pdi_sibling (reader, &pdi, info_ptr); continue;