gimli-rs / gimli

A library for reading and writing the DWARF debugging format

Home Page:https://docs.rs/gimli/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow `DW_AT_decl_file` = 0 for DWARF 5

philipc opened this issue · comments

Even though the DWARF 5 standard says "The value 0 indicates that no source file has been specified.", discussion on the DWARF mailing list indicates that this was an oversight. Additionally, LLVM does emit DW_AT_decl_file = 0 (and #606 changes dwarfdump to handle this). This change would mean we also don't need to duplicate the compilation file in the line table.

See 1f7de25 for the original implementation of the file index 0 handling.

We should also handle this better when reading, so that things like gimli-rs/addr2line#264 aren't needed.