gimli-rs / gimli

A library for reading and writing the DWARF debugging format
https://docs.rs/gimli/
Apache License 2.0
857 stars 109 forks source link

Add support for DW_LNCT_LLVM_source #728

Closed Mrmaxmeier closed 5 months ago

Mrmaxmeier commented 5 months ago

Hi,

this is a follow-up on #432 (fixes #431). The discussion in #432 is still relevant here: The accepted proposal explicitly deals with missing source attributes now by specifying that all provided embedded source attributes should be newline-terminated.

I don't think there's a clean way to implement this though. (=> I've added fn source_attr and fn source in this PR)

Let me know if you'd be okay with merging support for this feature without waiting for DWARF v6 :slightly_smiling_face: (I'd like to use this to simplify tests in rustc and wire up support in symbolic.)

philipc commented 5 months ago

The accepted proposal explicitly deals with missing source attributes now by specifying that all provided embedded source attributes should be newline-terminated.

The accepted proposal is https://dwarfstd.org/issues/180201.1.html, but that isn't the definitive version of what ends up in the standard. A further proposal modified this: https://dwarfstd.org/issues/211108.2.html. It would be better to refer to the draft standards (https://snapshots.sourceware.org/dwarfstd/dwarf-spec/) to see the current status, but I'm reluctant to implement that here before it is released (or close to it).

So, don't implement DW_LNCT_source for now. Adding DW_LNCT_LLVM_source is fine though.

Mrmaxmeier commented 5 months ago

So, don't implement DW_LNCT_source for now. Adding DW_LNCT_LLVM_source is fine though.

I'm still calling the attribute source at the moment. Should it explicitly be llvm_source instead?

Mrmaxmeier commented 4 months ago

Hi, can you cut a new release for crates.io? :slightly_smiling_face: (This PR includes a breaking change: FileInfo used to be Copy) Thanks!

philipc commented 4 months ago

Released 0.31.0