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

debuginfo: Fix DW_AT_containing_type vtable debuginfo regression #93503

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
debuginfo: Bring back DW_AT_containing_type for vtables -- address re…
…view comments
michaelwoerister committed Feb 8, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit ed21805aee9ad1abed5dc5157ac568e95fd84afb
4 changes: 3 additions & 1 deletion compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
Original file line number Diff line number Diff line change
@@ -2662,11 +2662,13 @@ fn vtable_type_metadata<'ll, 'tcx>(
}
ty::VtblEntry::Method(_) => {
// Note: This code does not try to give a proper name to each method
// because their might be multiple methods with the same name
// because there might be multiple methods with the same name
// (coming from different traits).
(format!("__method{}", index), void_pointer_type_debuginfo)
}
ty::VtblEntry::TraitVPtr(_) => {
// Note: In the future we could try to set the type of this pointer
// to the type that we generate for the corresponding vtable.
(format!("__super_trait_ptr{}", index), void_pointer_type_debuginfo)
Copy link
Member

Choose a reason for hiding this comment

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

This points to the super trait's vtable? It would be good (eventually) if we could set the type correctly here. I'm not sure if we might need to walk the tree of vtables for some reason ...

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, there is definitely room for improvement here. Types of the fn pointers as well. I'll add a comment about the super trait pointer.

}
ty::VtblEntry::MetadataAlign => ("align".to_string(), usize_debuginfo),
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs
Original file line number Diff line number Diff line change
@@ -470,7 +470,7 @@ fn push_debuginfo_type_name<'tcx>(
}

pub enum VTableNameKind {
// Is the name for const/static holding the vtable?
// Is the name for the const/static holding the vtable?
GlobalVariable,
// Is the name for the type of the vtable?
Type,