-
Notifications
You must be signed in to change notification settings - Fork 120
Description
The current conversion API is basically Dwarf:::from
(and similar methods on other types that are called by this). This method allows the caller to translate addresses, but nothing else. It would be useful to support other transformations during conversion. Currently the transform code in wasmtime duplicates a lot of Dwarf::from
, but there is a desire to use the code in gimli instead (bytecodealliance/wasmtime#5537).
The conversion needs to support at least:
- translation of addresses (not necessarily a one to one mapping)
- rewriting of expressions
- reshaping the DIE tree (pruning entries, or inserting new entries)
- replacing skeleton units with the DWO units
We should also try not to limit what can be done. I think this is best done by providing lower level APIs for possible actions during the conversion, while leaving the high level control flow to the caller.
The existing Dwarf::from
will be kept unchanged for those who don't need the flexibility (but it will be internally rewritten to use these new APIs).
#745 provides an implementation of this for the line program conversion, but we need to support converting the DIE tree too (and the things it references).