-
Notifications
You must be signed in to change notification settings - Fork 108
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
Allow remapping all of line program when rewriting #563
Comments
Note: this is related to this comment: rustwasm/walrus#71 (comment) by @philipc. |
FWIW this seems most reasonable IMO, and doesn't require any API changes, but I'm not sure if there are any use-cases it would break (like relocations perhaps?). |
I would like to note that From the comment you linked:
So following that approach, the solution is:
If that approach isn't suitable then we can certainly consider other solutions, such as a framework for transforming anything (not just addresses) during conversion, and the existing conversion would be the identity transformation. Or another option may be to make it easier to use the existing conversion as a library for converting individual entries, rather than simply converting entire sections at once. |
So for now I played with a branch to implement conversion directly in But yeah personally I think
would be just as fine a solution, my only concern is the comment on that property which suggests that maybe the Or maybe if we expose it purely as iterator ( |
I think |
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
acceptsconvert_address
, which seems like a good place for doing such rewriting, but currently when it reaches theLineProgram
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 ofgimli::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 theinstructions
mutable iterator?The text was updated successfully, but these errors were encountered: