Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for DW_LNCT_LLVM_source #728

Merged
merged 12 commits into from
Jun 28, 2024

Conversation

Mrmaxmeier
Copy link
Contributor

@Mrmaxmeier Mrmaxmeier commented Jun 27, 2024

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 🙂
(I'd like to use this to simplify tests in rustc and wire up support in symbolic.)

@philipc
Copy link
Collaborator

philipc commented Jun 28, 2024

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.

src/write/line.rs Show resolved Hide resolved
src/read/line.rs Outdated Show resolved Hide resolved
src/read/line.rs Outdated Show resolved Hide resolved
@Mrmaxmeier
Copy link
Contributor Author

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?

Copy link
Collaborator

@philipc philipc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

No, leave it as source, it will be used for both in future.

src/write/line.rs Show resolved Hide resolved
src/read/line.rs Outdated Show resolved Hide resolved
src/write/line.rs Outdated Show resolved Hide resolved
src/write/line.rs Outdated Show resolved Hide resolved
src/write/line.rs Outdated Show resolved Hide resolved
Mrmaxmeier and others added 2 commits June 28, 2024 11:51
Co-authored-by: Philip Craig <philipjcraig@gmail.com>
@Mrmaxmeier Mrmaxmeier changed the title Add support for DW_LNCT_source (DWARFv5 source code embedding extension) Add support for DW_LNCT_LLVM_source Jun 28, 2024
Copy link
Collaborator

@philipc philipc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@philipc philipc merged commit aca0c42 into gimli-rs:master Jun 28, 2024
20 checks passed
@Mrmaxmeier Mrmaxmeier deleted the embedded-source branch June 28, 2024 10:42
@Mrmaxmeier
Copy link
Contributor Author

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

@philipc
Copy link
Collaborator

philipc commented Jul 16, 2024

Released 0.31.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support DW_LNCT_LLVM_source
2 participants