+
Skip to content

Allow remapping all of line program when rewriting #563

Open
@RReverser

Description

@RReverser

When modifying source locations in the binary (like in Wasm use-cases), it's desirable to rewrite all of the debugging information to match the new addresses.

Dwarf::from accepts convert_address, which seems like a good place for doing such rewriting, but currently when it reaches the LineProgram conversion, it only executes the callback for the base address (SetAddress) instruction and not for individual offsets after that, making granular per-instruction address updates impossible.

One way to work around this issue would be to get mutable access to the instructions property of gimli::write::LineProgram and walk over instructions and updates offsets manually, but currently that property isn't exposed either.

What would be the best way to allow such granular rewrites? Should we call convert_address on each individual instruction and recalculate offsets, or would it be better to add a separate callback to the API, or expose the instructions mutable iterator?

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

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载