debuginfo: Make DWARF representation of enums uniform.
So far the DWARF information for enums was different for regular enums, univariant enums, Option-like enums, etc. Regular enums were encoded as unions of structs, while the other variants were encoded as bare structs. With the changes in this PR all enums are encoded as unions so that debuggers can reconstruct if something originally was a struct, a univariant enum, or an Option-like enum. For the latter case, information about the Null variant is encoded into the union field name. This information can then be used by the debugger to print a None value actually as None instead of Some(0x0).
This commit is contained in:
parent
138089355d
commit
eea329b0f7
11 changed files with 221 additions and 145 deletions
|
@ -27,7 +27,7 @@
|
|||
// gdb-check:$3 = {{Case3, a = 0, b = 22873, c = 22873, d = 22873, e = 22873}, {Case3, a = 0, b = 1499027801, c = 1499027801}, {Case3, a = 0, b = 6438275382588823897}}
|
||||
|
||||
// gdb-command:print univariant
|
||||
// gdb-check:$4 = {a = -1}
|
||||
// gdb-check:$4 = {{a = -1}}
|
||||
|
||||
#![feature(struct_variant)]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue