This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rust/21097] can't disambiguate between enum and other types for rust


https://sourceware.org/bugzilla/show_bug.cgi?id=21097

--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
I can get the same unusual debuginfo from a simple test:

pub struct Mod {
    v: i32
}
pub enum ItemKind {
    Mod(Mod)
}

fn x() -> ItemKind {
    return ItemKind::Mod(Mod{v: 23});
}

pub fn main() {
    match x() {
        ItemKind::Mod(z) => {
            println!("{}", z.v);
        }
    }
}


This yields:

 <2><5d>: Abbrev Number: 7 (DW_TAG_structure_type)
    <5e>   DW_AT_name        : (indirect string, offset: 0x353): Mod
    <62>   DW_AT_byte_size   : 4
 <3><63>: Abbrev Number: 8 (DW_TAG_member)
    <64>   DW_AT_name        : (indirect string, offset: 0x141): __0
    <68>   DW_AT_type        : <0x6e>
    <6c>   DW_AT_data_member_location: 0
 <3><6d>: Abbrev Number: 0
 <2><6e>: Abbrev Number: 7 (DW_TAG_structure_type)
    <6f>   DW_AT_name        : (indirect string, offset: 0x353): Mod
    <73>   DW_AT_byte_size   : 4
 <3><74>: Abbrev Number: 8 (DW_TAG_member)
    <75>   DW_AT_name        : (indirect string, offset: 0x351): v
    <79>   DW_AT_type        : <0x5e9>
    <7d>   DW_AT_data_member_location: 0
 <3><7e>: Abbrev Number: 0


However, I couldn't get gdb to print the wrong type here.
So, something else must be going on.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]