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

Support DWARF version 5 operations and corresponding GNU extensions #140

Closed
10 tasks done
philipc opened this issue Oct 6, 2016 · 8 comments
Closed
10 tasks done
Assignees

Comments

@philipc
Copy link
Collaborator

philipc commented Oct 6, 2016

My rust binaries are linked with objects that use DW_OP_GNU_entry_value. Now that gimli's dwarfdump is displaying locs, it panics when trying to dump my rust binaries.

I think I've seen DW_OP_GNU_implicit_pointer in use somewhere too.

DWARF 5 operations:

  • DW_OP_implicit_pointer
  • DW_OP_addrx
  • DW_OP_constx
  • DW_OP_entry_value
  • DW_OP_const_type
  • DW_OP_regval_type
  • DW_OP_deref_type
  • DW_OP_xderef_type
  • DW_OP_convert
  • DW_OP_reinterpret
@tromey
Copy link
Member

tromey commented Oct 6, 2016

dwarf2.def lists the GNU extensions and in most cases provides a link to documentation:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=include/dwarf2.def;h=64850714ca436e988a11dfeef4d22ea0dc437c59;hb=HEAD#l598

Not all of these are in active use. DW_OP_GNU_encoded_addr isn't implemented by gdb, so probably not used. IIRC DW_OP_GNU_uninit isn't generated by GCC by default. The others can be generated though. Note that the typed stack stuff will need relatively large changes to the evaluator.

@tromey
Copy link
Member

tromey commented Oct 6, 2016

Also, I think it would be better not to panic when dumping something unknown.

@philipc
Copy link
Collaborator Author

philipc commented Oct 6, 2016

Also, I think it would be better not to panic when dumping something unknown.

Yeah, gimli's dwarfdump currently uses expect everywhere. This is fine as a validation tool. Definitely should be fixed if dwarfdump is going to see general usage, but that's not a high priority goal for me now (and if that were the goal, then I would probably stop trying to clone libdwarf's dwarfdump output so closely).

@philipc philipc self-assigned this Oct 14, 2016
@tromey
Copy link
Member

tromey commented Oct 14, 2016

The DWARF 5 draft is out now and promotes these to standard.

@philipc philipc removed their assignment Oct 15, 2016
@philipc philipc changed the title Support GNU operation extensions (DW_OP_GNU_entry_value) Support DWARF version 5 operations and corresponding GNU extensions Oct 16, 2016
@philipc
Copy link
Collaborator Author

philipc commented Oct 16, 2016

DW_OP_implicit_pointer and DW_OP_entry_value implemented in #150

@tromey
Copy link
Member

tromey commented Aug 13, 2017

I started work on this here: https://github.com/tromey/gimli/tree/dwarf-5-eval. But it needs a rebase and isn't complete.

@philipc philipc self-assigned this Apr 24, 2018
@philipc
Copy link
Collaborator Author

philipc commented May 7, 2018

Typed operations were implemented in #293. DW_OP_addrx was started in #242.

@philipc
Copy link
Collaborator Author

philipc commented Feb 1, 2019

DW_OP_addrx and DW_OP_constx were implemented in #358. All done!

@philipc philipc closed this as completed Feb 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants