-
Notifications
You must be signed in to change notification settings - Fork 9
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
Sourcemap support for wasm #27
Conversation
0dde597
to
273c77a
Compare
For now, we can probably run the command |
I did that. Running |
wat_file | ||
output_file = | ||
let sourcemap_file = | ||
if Sys.command "wasm-merge -osm foo 2> /dev/null" <> 0 then None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if Sys.command "wasm-merge -osm foo 2> /dev/null" <> 0 then None | |
if Option.is_none sourcemap_file || Sys.command "wasm-merge -osm foo 2> /dev/null" <> 0 then None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would still call wasm-metadce
with the -osm
option though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If sourcemap_file
is None
, one does not need to check for source map support, and wasm-metadce
is not going to be called with the -osm
option, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I was confused. Done.
Thanks! |
Implement mapping between source and wasm locations. To work, this requires a version of Binaryen compiled with Jérôme's patch WebAssembly/binaryen#6372. Single-stepping can jump around in slightly surprising ways in the OCaml code, due to the different order of operations in wasm. This could be improved by modifying Binaryen to support “no location” annotations. Another future improvement can be to support mapping Wasm identifiers to OCaml ones. Co-authored-by: Jérôme Vouillon <[email protected]>
0cc0f8d
to
628d4e0
Compare
I rebased the PR and squashed the history as it looked a bit weird. |
Thanks! |
Implement mapping between source and wasm locations.
To work, this requires a version of Binaryen compiled with Jérôme's patch WebAssembly/binaryen#6372, so I’m opening this a draft for now.
Single-stepping can jump around in slightly surprising ways in the OCaml code, due to the different order of operations in wasm. This could be improved by modifying Binaryen to support “no location” annotations. Another future improvement can be to support mapping Wasm identifiers to OCaml ones.