diff options
author | Tom de Vries <tdevries@suse.de> | 2024-10-08 12:27:20 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-10-08 12:27:20 +0200 |
commit | 42d385542f5f948e68db256b249662683057b288 (patch) | |
tree | 4f0afe17b4485ddd50da7a18ae1e77ce953d0529 /gdb/annotate.h | |
parent | e808bbbe37dda4a3ec5872ff990090cc746ad7ac (diff) | |
download | gdb-42d385542f5f948e68db256b249662683057b288.zip gdb-42d385542f5f948e68db256b249662683057b288.tar.gz gdb-42d385542f5f948e68db256b249662683057b288.tar.bz2 |
[gdb/symtab] Fix parent of enumerator
As mentioned in commit 489b82720f5 ('[gdb/symtab] Revert "Change handling of
DW_TAG_enumeration_type in DWARF scanner"'), when doing "maint print objfiles" in
test-case gdb.dwarf2/enum-type.exp, for val1 we get an entry without parent:
...
[27] ((cooked_index_entry *) 0x7fbbb4002ef0)
name: val1
canonical: val1
qualified: val1
DWARF tag: DW_TAG_enumerator
flags: 0x0 []
DIE offset: 0x124
parent: ((cooked_index_entry *) 0)
...
This happens here in cooked_indexer::index_dies:
...
info_ptr = recurse (reader, info_ptr,
is_enum_class ? this_entry : parent_entry,
fully);
...
when we're passing down a nullptr parent_entry, while the parent of this_entry
is deferred.
Fix this in cooked_indexer::index_dies by passing down a deffered parent
instead, such that we get:
...
[27] ((cooked_index_entry *) 0x7ff0e4002ef0)^M
name: val1^M
canonical: val1^M
qualified: ns::val1^M
DWARF tag: DW_TAG_enumerator^M
flags: 0x0 []^M
DIE offset: 0x124^M
parent: ((cooked_index_entry *) 0x7ff0e4002f20) [ns]^M
...
Tested on x86_64-linux.
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/annotate.h')
0 files changed, 0 insertions, 0 deletions