After D134378, we started seeing crashes with incomplete types (in the
context of shared libraries).
When trying to print a std::vector<int> & with only debug info for a
declaration, we now try to use the formatter after D134378. With an
incomplete type, this somehow goes into infinite recursion with the
frames
lldb_private::ValueObject::Dereference lldb_private::ValueObjectSynthetic::CreateSynthFilter lldb_private::ValueObjectSynthetic::ValueObjectSynthetic lldb_private::ValueObject::CalculateSyntheticValue lldb_private::ValueObject::HasSyntheticValue
This has to do with FrontEndWantsDereference that some STL formatters
set, causing recursion between the formatter (which tries to dereference),
and dereferencing (which wants to know if there's a formatter to avoid dereferencing).
The reason this only started appearing after D134378 was because
previously with incomplete types, for names with <, lldb would attempt
to parse template parameter DIEs, which were empty, then create an empty
ClassTemplateSpecializationDecl which overrode the name used to lookup
a formatter in FormattersMatchData() to not include template
parameters (e.g. std::vector<> &). After D134378 we don't create a
ClassTemplateSpecializationDecl when there are no template parameters
and the name to lookup a formatter is the original name (e.g.
std::vector<int> &).
The code to try harder with incomplete child compiler types was added in
D79554 for ObjC purposes.
Maybe worth filing a bug and referencing it here?
Is this limitation still necessary if the incomplete type has template parameter DIEs? (I guess probably yes, because it'll be missing member descriptions, etc)
& does this path get hit if the type is declared in one CU but defined in another? (& does the inf recurse/crash loop still get hit in that case, without this patch?)