Skip to content

Lower level conversion API #804

@philipc

Description

@philipc

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions