Description
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?