aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2021-06-21 13:14:05 +0200
committerTom de Vries <tdevries@suse.de>2021-06-24 17:48:26 +0200
commitf7b5068c5f41aa13ee3efa35a2555c3bfafe81f0 (patch)
tree5f43f50573192ade4838355b6c239a6d7df466ac /gdb
parent8191098cb5b5ce1d77cac93272ce8eb6e0c34521 (diff)
downloadbinutils-f7b5068c5f41aa13ee3efa35a2555c3bfafe81f0.zip
binutils-f7b5068c5f41aa13ee3efa35a2555c3bfafe81f0.tar.gz
binutils-f7b5068c5f41aa13ee3efa35a2555c3bfafe81f0.tar.bz2
[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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/dwarf2/read.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 6c0dc60..e678966 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;