[PATCH 08/14] Remove symtab links from dwarf2_psymtab and dwarf2_per_cu_quick_data
Tom Tromey
tom@tromey.com
Sat Feb 22 00:38:00 GMT 2020
>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
Simon> I was going to say the same thing, a getter on dwarf2_unshareable
Simon> would be nice. Since this is a new data type, we might as well
Simon> design it right from the start.
I ended up with a method on dwarf2_per_objfile.
>>> + std::vector<gdb::optional<compunit_symtab *>> symtabs;
Simon> Having pointers in an optional gives us three states:
Simon> 1- not instantiated
Simon> 2- instantiated but NULL
Simon> 3- instantiated and not NULL
Simon> Do we actually need the distinction between 1 and 2 here? If not, I think the optional
Simon> doesn't bring much and just makes the code more complicated.
Yes, it's weird; but I did this to preserve the status quo.
It's possible that this is not needed but figuring that out seemed like
a separate effort.
It's possible that this can only happen for include psymtabs.
I plan to make a separate subclass for these, which would clarify this
somewhat. But I'd rather get this series in first.
Tom
More information about the Gdb-patches
mailing list