Skip to content

[cherry-pick][swift/release/6.0] [lldb][DataFormatter] unordered_map: account for new libc++ __hash_node layout #8695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Michael137
Copy link

Since D101206 (ba79fb2e1ff7130cde02fbbd325f0f96f8a522ca) the __hash_node::__value_ member is wrapped in an anonymous union. ValueObject::GetChildMemberWithName doesn't see through the union.

This patch accounts for this possible new layout by getting a handle to the union before doing the by-name __value_ lookup.

(cherry picked from commit 7493d45)

…de layout (llvm#68574)

Since D101206 (`ba79fb2e1ff7130cde02fbbd325f0f96f8a522ca`) the `__hash_node::__value_`
member is wrapped in an anonymous union. `ValueObject::GetChildMemberWithName` doesn't see
through the union.

This patch accounts for this possible new layout by getting a handle to
the union before doing the by-name `__value_` lookup.

(cherry picked from commit 7493d45)
@Michael137 Michael137 requested a review from adrian-prantl May 4, 2024 00:33
@Michael137
Copy link
Author

@swift-ci test

Copy link

@adrian-prantl adrian-prantl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the fact that this commit came without a test also the reason why we missed it? ;-)

@Michael137
Copy link
Author

Is the fact that this commit came without a test also the reason why we missed it? ;-)

Hehe seems like it. The current tests will always only test the layout of the freshly built libc++. One thing we could do is run all the formatters against the system SDK and also the newly built libc++ (this wouldn't of course be bullet-proof). Another option is to follow what we did for std::string, where we hardcode all the different formats that ever existed for std::string in the tests, and make sure the formatters work for those (https://github.com/llvm/llvm-project/blob/72e2e4f7dc682fa3f6eda9f3cfbd20a8ffaac4e4/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/simulator/main.cpp).

@adrian-prantl adrian-prantl merged commit 17ebaf8 into swiftlang:swift/release/6.0 May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants