-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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: Generate DW_TAG_template_type_parameter DIEs for generic types #9224
Comments
Triage bump... Nothing has been done here yet. |
Triage: still no change |
Triage: no change |
I'm a little confused by this issue, since gdb seems to indicate the same output from both C++ code (g++ compiled). Perhaps someone could explain what specifically we expect to be different? I've provided C++ and Rust code below as well as gdb output (which is effectively identical). This issue is somewhat similar to #8641 in my opinion. template<class T>
struct generic {
T a;
};
struct normal {
int a;
};
int main() {
auto generic_t = generic<int> { 10 };
auto normal_t = normal { 10 };
return 0;
}
pub struct Generic<T: Clone>(T);
pub struct Normal(i32);
fn main () {
let generic = Generic(10);
let normal = Normal(10);
generic;
normal;
}
|
We generate
|
Not always, for example in the test case given earlier, I don't see template tags. The DWARF for
(Ignore that unknown AT value thing, that's an out-of-date |
BTW this does affect gdb, see https://sourceware.org/bugzilla/show_bug.cgi?id=21466 |
Yes, template parameter descriptions are only emitted for functions and methods. There is no reason why data types should not be supported. It just has never been urgent enough for someone to put time into it. |
That was the wrong gdb bug btw, the correct one is https://sourceware.org/bugzilla/show_bug.cgi?id=21893 |
This changes debuginfo generation to add template parameters to generic types. With this change the DWARF now has DW_TAG_template_type_param for types, not just for functions, like: <2><40d>: Abbrev Number: 6 (DW_TAG_structure_type) <40e> DW_AT_name : (indirect string, offset: 0x375): Generic<i32> <412> DW_AT_byte_size : 4 <413> DW_AT_alignment : 4 ... <3><41f>: Abbrev Number: 8 (DW_TAG_template_type_param) <420> DW_AT_type : <0x42a> <424> DW_AT_name : (indirect string, offset: 0xa65e): T Closes rust-lang#9224
… r=michaelwoerister Add template parameter debuginfo to generic types This changes debuginfo generation to add template parameters to generic types. With this change the DWARF now has DW_TAG_template_type_param for types, not just for functions, like: <2><40d>: Abbrev Number: 6 (DW_TAG_structure_type) <40e> DW_AT_name : (indirect string, offset: 0x375): Generic<i32> <412> DW_AT_byte_size : 4 <413> DW_AT_alignment : 4 ... <3><41f>: Abbrev Number: 8 (DW_TAG_template_type_param) <420> DW_AT_type : <0x42a> <424> DW_AT_name : (indirect string, offset: 0xa65e): T Closes rust-lang#9224
This changes debuginfo generation to add template parameters to generic types. With this change the DWARF now has DW_TAG_template_type_param for types, not just for functions, like: <2><40d>: Abbrev Number: 6 (DW_TAG_structure_type) <40e> DW_AT_name : (indirect string, offset: 0x375): Generic<i32> <412> DW_AT_byte_size : 4 <413> DW_AT_alignment : 4 ... <3><41f>: Abbrev Number: 8 (DW_TAG_template_type_param) <420> DW_AT_type : <0x42a> <424> DW_AT_name : (indirect string, offset: 0xa65e): T Closes rust-lang#9224
… r=michaelwoerister Add template parameter debuginfo to generic types This changes debuginfo generation to add template parameters to generic types. With this change the DWARF now has DW_TAG_template_type_param for types, not just for functions, like: <2><40d>: Abbrev Number: 6 (DW_TAG_structure_type) <40e> DW_AT_name : (indirect string, offset: 0x375): Generic<i32> <412> DW_AT_byte_size : 4 <413> DW_AT_alignment : 4 ... <3><41f>: Abbrev Number: 8 (DW_TAG_template_type_param) <420> DW_AT_type : <0x42a> <424> DW_AT_name : (indirect string, offset: 0xa65e): T Closes rust-lang#9224
…oerister Add template parameter debuginfo to generic types This changes debuginfo generation to add template parameters to generic types. With this change the DWARF now has DW_TAG_template_type_param for types, not just for functions, like: <2><40d>: Abbrev Number: 6 (DW_TAG_structure_type) <40e> DW_AT_name : (indirect string, offset: 0x375): Generic<i32> <412> DW_AT_byte_size : 4 <413> DW_AT_alignment : 4 ... <3><41f>: Abbrev Number: 8 (DW_TAG_template_type_param) <420> DW_AT_type : <0x42a> <424> DW_AT_name : (indirect string, offset: 0xa65e): T Closes #9224
check macro statements in `[non_copy_const]` close rust-lang#8493 close rust-lang#9224 This PR fixes false positives in `[non_copy_const]`. changelog: fix false positives in`[non_copy_const]` --- r? `@Jarcho`
Section
5.5.8 Class Template Instantiations
of the DWARF 4 standard says:and later (two of the five mentioned exceptions):
These things are not done yet: For generic types we describe their monomorphized version, losing the information that they stem from a generic definition. In order to fix this issue, the following two things need to be done:
DW_TAG_template_type_parameter
metadata entries for each generic parameter like already done for generic functions.The text was updated successfully, but these errors were encountered: