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 DW_LANG_Rust in DWARF #503

Merged
merged 1 commit into from
Jun 18, 2021
Merged

Use DW_LANG_Rust in DWARF #503

merged 1 commit into from
Jun 18, 2021

Conversation

tromey
Copy link
Contributor

@tromey tromey commented Jun 18, 2021

This changes the GCC DWARF emitterto use DW_LANG_Rust or
DW_LANG_Rust_old as appropriate.

This changes the GCC DWARF emitterto use DW_LANG_Rust or
DW_LANG_Rust_old as appropriate.
@philberty philberty added the GCC label Jun 18, 2021
@dkm
Copy link
Member

dkm commented Jun 18, 2021

Maybe the PR template content (Thank you for making Rust GCC better!....) could be removed from the first comment? It will end-up in the git log :)

@tromey
Copy link
Contributor Author

tromey commented Jun 18, 2021

I edited the comment, no idea if that really works.

@philberty
Copy link
Member

bors r+

@bors
Copy link
Contributor

bors bot commented Jun 18, 2021

Build succeeded:

@bors bors bot merged commit e200b89 into Rust-GCC:master Jun 18, 2021
@tromey tromey deleted the gccrs-master branch June 18, 2021 19:43
@dkm
Copy link
Member

dkm commented Jun 19, 2021

I edited the comment, no idea if that really works.

Yes, editing the first comment works ! Thanks !

@tschwinge
Copy link
Member

My understanding of DWARF is limited, so please bear with me. ;-)

@tromey, I suppose that DW_LANG_Rust/DW_LANG_Rust_old have originally been created for rustc/LLVM proper. Meaning that GDB (or any other consumer) will (I suppose) use this to "switch to expecting to see rustc/LLVM idioms" in the debug information (whatever that exactly means in practice). Are there now any caveats that GCC/Rust has to make sure to follow (produce) the same idioms, so that GDB etc. understand GCC/Rust debug information the same way as what rustc/LLVM produces?

Or, are DW_LANG_Rust/DW_LANG_Rust_old agnostic of the exact producer (rustc/LLVM vs. GCC/Rust), meaning that as long as the producer follows the specification, GDB etc. don't care -- in theory as well as in practice? (I further suppose that if in theory but not in practice, that then points to GDB etc. bugs to be fixed.)

And no, I don't have a specific concern, I was just curious. (Hope you understood my concern.)

@tschwinge
Copy link
Member

Aha -- what I mean are things like #514. ;-) But I suppose that's fine -- we just have to pay attention to such conventions.

@tromey
Copy link
Contributor Author

tromey commented Jun 29, 2021

I understand your concern, but there's nothing too much to be worried about. DWARF varies between compilers but also between different versions of compilers. Debuggers are naturally resilient to this to some degree; and GDB at least will add compiler-specific workarounds when needed (either by pattern matching or by examining the producer string). Mentioning the language of the CU is just a good practice and it lets GDB know that it should start up in "rust mode".

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

Successfully merging this pull request may close these issues.

4 participants