-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
debug info emitted for trait objects has wrong size/alignment #88873
Comments
Thanks for the bug report, @khuey! Yes, it looks like debuginfo for |
#93006 (which was just merged and should be in a nightly soon) improves debuginfo for fat pointers. You now get the following debuginfo for the actual fat pointer type:
Does that help? |
I expect it will. I'll test next week. |
I actually can't really test this in my debugger because rustc's vtable debug info changed and deleted the DW_AT_containing_type entries. It looks like that's getting fixed in #93503 though. |
Alright I did get around to testing this and what you landed is sufficient. Thanks! |
Great! |
Consider:
The DWARF debug info for this will contain the following DIE
The DW_TAG_members have been synthesized via
trait_pointer_metadata
and are correct. But the DW_TAG_structure_type's size and alignment have been computed from theLayout
of the type and are wrong.These incorrect values are computed by the
ty::Dynamic
branch oflayout_of_uncached
which doesUnsurprisingly, passing in an empty set of members produces a zero sized layout.
For comparison,
ty::Ref
is handled differently and produces the correct outputThe incorrect values above result in our debugger being unable to do anything useful with
do_it
'sfoo
parameter.The text was updated successfully, but these errors were encountered: