Skip to content

extra namespace in DWARF on nightly #33193

Closed
@tromey

Description

@tromey

There is a test in our gdb work that has a unit-like struct:

pub struct Unit;

This is in a crate named simple.

In 1.8 this ended up as a struct Unit in a namespace simple; so in gdb print could easily display simple::Unit, as that was the name of the type.

In nightly there is an extra namespace:

 <2><16d>: Abbrev Number: 3 (DW_TAG_namespace)
    <16e>   DW_AT_name        : (indirect string, offset: 0x1da): Unit
    <172>   DW_AT_decl_file   : 1
    <173>   DW_AT_decl_line   : 45
 <3><174>: Abbrev Number: 11 (DW_TAG_structure_type)
    <175>   DW_AT_name        : (indirect string, offset: 0x1da): Unit
    <179>   DW_AT_byte_size   : 0

... so now the type is named simple::Unit::Unit.

I think the 1.8 behavior was preferable. I don't think the extra namespace serves a useful purpose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions