[PATCH 4/5] [gdb/symtab] Fix parent of enumerator
Tom Tromey
tom@tromey.com
Fri Sep 13 19:45:42 GMT 2024
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
Tom> const gdb_byte *index_dies (cutu_reader *reader,
Tom> const gdb_byte *info_ptr,
Tom> const cooked_index_entry *parent_entry,
Tom> + parent_map::addr_type parent_defer,
Tom> bool fully);
I wonder if there could be a single argument for the parent.
I want to say it should be a cooked_index_entry_ref, but that would
necessitate putting a flag in that object, and maybe that would increase
the size of cooked_index_entry.
Maybe a std::variant though.
Tom> @@ -16486,6 +16492,12 @@ cooked_indexer::index_dies (cutu_reader *reader,
Tom> cooked_index_entry *this_entry = nullptr;
Tom> if (name != nullptr)
Tom> {
Tom> + if (parent_defer)
Tom> + {
Tom> + gdb_assert (defer == 0);
Tom> + defer = parent_defer;
Tom> + }
Is it possible for this assert to trigger if the DWARF is sufficiently
weird?
Not that we should support super weird stuff, just that gdb shouldn't
crash in repsonse.
Also, why not initialize defer to be parent_defer?
I guess I find the placement of this code a little mysterious.
Tom
More information about the Gdb-patches
mailing list