[lldb][DataFormatters] Adjust retrieval of unordered_map element type #10701
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A user ran into an issue where the libc++
std::unordered_map
formatter fails because it can't deduce theelement_type
. That happens because thenode_type
is a forwad declaration. And, in fact, dsymutil stripped the definition forstd::__1::__hash_node<...>
for a particular instantiation. While I'm still unclear whether this is a dsymutil bug, this patch works around said issue by getting the element type from the__table_
member.Drive-by:
m_element_type
inUpdate
, which is where the other members are initializedI don't have a reduced example of this unfortunately. But the crux of the issue is that
std::__1::__hash_node<...>
only has a forward declaration in the dsym. Then trying to callGetTypeTemplateArgument
on thatCompilerType
fails. And even if the definition was present in the dsym it seems like we're stopped in a context where the CU only had a forward declaration DIE for that type and thenode_type
never ends up being completed with the definition that lives in another CU.rdar://150813798