Skip to content

Paths to source files for inlined items from extern crates not absolute in debuginfo #34179

Closed
@luser

Description

@luser

@eddyb and I have been poking at this on IRC for a little bit. For code that's linked in from an extern crate, the source file paths that wind up in the debug info have relative paths, like:

< 4><0x000000ab>          DW_TAG_subprogram
                            DW_AT_low_pc                0x00005570
                            DW_AT_high_pc               <offset-from-lowpc>170
                            DW_AT_frame_base            len 0x0001: 56: DW_OP_reg6
                            DW_AT_linkage_name          "_ZN16rust_bin_example4iter8Iterator23count<std::env::ArgsOs>E"
                            DW_AT_name                  "count<std::env::ArgsOs>"
                            DW_AT_decl_file             0x00000003 ../src/libcore/iter.rs
                            DW_AT_decl_line             0x000001d0

For the debug symbols that we generate from Firefox binaries, we wind up interpreting these relative to the compilation dir of the rust crate we're compiling that imports them, so the paths wind up completely wrong, like /build/debug-mozilla-central/media/libstagefright/../src/libcore/option.rs (actual output from my local Firefox build).

If there were absolute paths, they'd be persisted all the way through, and then we could do something useful with them.

Longer-term it'd be great if we also persisted info about what source repository and revision they were built from, or something like that, but we'd be inventing things there, since there's no analogue in existing DWARF produced by C compilers, AFAIK.

/cc @rillian

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions