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

Use DWARF 5 value for DW_LANG_Rust #32734

Merged
merged 1 commit into from
Apr 8, 2016

Conversation

tromey
Copy link
Contributor

@tromey tromey commented Apr 4, 2016

DWARF 5 has assigned a value for DW_LANG_Rust. See the relevant DWARF issue. Although DWARF 5 is not yet released, it seems ok to use this value as both GCC and LLVM are already using other DW_LANG_ constants assigned in this way.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @arielb1 (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@alexcrichton
Copy link
Member

r? @michaelwoerister

@michaelwoerister
Copy link
Member

Let's give it a try. Debuggers will hopefully use the same fallback mechanisms they are using now if they don't recognise the value. Thanks for the PR,Tom!

@michaelwoerister
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Apr 5, 2016

📌 Commit a0943d0 has been approved by michaelwoerister

@sanxiyn
Copy link
Member

sanxiyn commented Apr 5, 2016

Eh, isn't it wise to refrain from using DW_LANG_Rust until we are somewhat sure about debug info generation scheme?

While reading through gdb source, I found many paragraphs like the following one in ada-lang.c:

The purpose of this routine is to allow us to support older versions of the compiler by detecting the use of the older encoding, and by fixing up the INDEX_DESC_TYPE to follow the new one (at this point, we essentially replace each field's meaningless type by the associated index subtype).

@tromey
Copy link
Contributor Author

tromey commented Apr 5, 2016

You shouldn't use the Ada support in gdb as a guide. Ada is very special in gdb, and not in a good way. For example, that quoted paragraph is actually referring to Ada's use of magic symbols to guide debuginfo interpretation, because for some historical reason the Ada compiler did not emit DWARF for all its constructs.

My past experience in debuginfo generation and reading is that compilers are never done. There are always bugs requiring workarounds in the debugger. The simplest way to dig for these in gdb is to search for "quirk". The general method here is producer sniffing, which would work just fine for Rust as well.

Manishearth added a commit to Manishearth/rust that referenced this pull request Apr 7, 2016
…aelwoerister

Use DWARF 5 value for DW_LANG_Rust

DWARF 5 has assigned a value for `DW_LANG_Rust`.  See [the relevant DWARF issue](http://www.dwarfstd.org/ShowIssue.php?issue=140129.1).  Although DWARF 5 is not yet released, it seems ok to use this value as both GCC and LLVM are already using other `DW_LANG_` constants assigned in this way.
bors added a commit that referenced this pull request Apr 7, 2016
Rollup of 7 pull requests

- Successful merges: #32687, #32729, #32731, #32732, #32734, #32737, #32741
- Failed merges:
@bors bors merged commit a0943d0 into rust-lang:master Apr 8, 2016
@tromey tromey deleted the dwarf-5-DW_LANG_Rust branch August 1, 2018 16:36
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.

7 participants