-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix debuginfo for unsized struct members #38543
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
The member was given the size of a fat pointer, which caused llvm to emit DWARF attributes for a 128-bit bitfield.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nrc (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Thanks for the PR!
What does it emit after this change? |
For the test case I added, it emitted this before:
and this after:
In both case, the I'm not sure that this is completely correct yet, but at least it is consistent. The reason I'm not sure it is correct is that in C the equivalent type is a flexible array, and I think these are given a size of 0 in DWARF, whereas rust unsized arrays are given the size of the first element. Also note that this only caused a problem for gdb without rust support, because the rust support in gdb ignores bitfield attributes. |
Thanks for the additional info. It's still not really correct but it's definitely an improvement over what we have now. |
@bors r+ |
📌 Commit af34f91 has been approved by |
Fix debuginfo for unsized struct members The member was given the size of a fat pointer, which caused llvm to emit DWARF attributes for a 128-bit bitfield.
☀️ Test successful - status-appveyor, status-travis |
Thanks again for the PR! |
The member was given the size of a fat pointer, which caused
llvm to emit DWARF attributes for a 128-bit bitfield.