Skip to content
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

🍒 [lldb] Fix crash missing MSInheritanceAttr with DWARF on Windows (#112928) #9542

Conversation

weliveindetail
Copy link

Member pointers refer to data or function members of a CXXRecordDecl, which require a MSInheritanceAttr in order to be complete. Without that we cannot calculate the size of a member pointer in memory. The attempt has been causing a crash further down in the clang AST context. In order to implement the feature, DWARF might need a new attribute to convey the information. For the moment, this patch teaches LLDB to handle to situation and avoid the crash.

…ows (llvm#112928)

Member pointers refer to data or function members of a `CXXRecordDecl`,
which require a `MSInheritanceAttr` in order to be complete. Without that
we cannot calculate the size of a member pointer in memory. The attempt
has been causing a crash further down in the clang AST context. In order
to implement the feature, DWARF will need a new attribtue to convey the
information. For the moment, this patch teaches LLDB to handle to
situation and avoid the crash.
@weliveindetail
Copy link
Author

We could add llvm#115177 here as well if it gets reviewed soon.

llvm#115177)

Following up from llvm#112928, we
can reuse the approach from Clang Sema to infer the MSInheritanceModel
and add the necessary attribute manually. This allows the inspection of
member function pointers with DWARF on Windows.
@weliveindetail weliveindetail requested a review from a team as a code owner November 27, 2024 16:55
@weliveindetail
Copy link
Author

@hjyamauchi @compnerd It would be great to land these cherry-picks in isolation from #9513 Can you trigger the CI please?

@compnerd
Copy link
Member

@swift-ci please test

@weliveindetail
Copy link
Author

Windows build failed for an unrelated reason. Didn't reach the test stage.

@hjyamauchi
Copy link

@swift-ci please test Windows Platform

@compnerd
Copy link
Member

compnerd commented Dec 2, 2024

@swift-ci please test Windows platform

@compnerd compnerd merged commit 31d4a33 into swiftlang:stable/20240723 Dec 2, 2024
3 checks passed
@weliveindetail weliveindetail deleted the cherrypick-lldb-msabi-member-pointers-crash branch December 3, 2024 10:55
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.

3 participants