You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it is not easily possible to debug or pretty print Wasmi bytecode as generated by the wasmi::Engine.
However, for debugging or inspection purposes or simply for learning how Wasmi produces bytecode it would be very helpful if Wasmi provided an out-of-the-box way to print Wasmi bytecode of a specified function or maybe even the entire compiled Wasm module.
For this we ideally have 2 different mode as is the standard in Rust: Debug and Display
Debug would try to stay as close as possible to the underlying Wasmi bytecode data structures while being a bit more readable to the user.
Display would optimize on readability and provide a mostly assembly-like reading experience. This could include costly turning branch offsets into labels dividing basic blocks etc.
The Wasmi CLI should expose this functionality in some way.
It must be noted that these print representations might change over time and thus are not a choice for (de)serialization.
If the resulting code to support this feature is very large we might want to put this entire functionality behind a crate feature debug or printing.
The text was updated successfully, but these errors were encountered:
Currently it is not easily possible to debug or pretty print Wasmi bytecode as generated by the
wasmi::Engine
.However, for debugging or inspection purposes or simply for learning how Wasmi produces bytecode it would be very helpful if Wasmi provided an out-of-the-box way to print Wasmi bytecode of a specified function or maybe even the entire compiled Wasm module.
For this we ideally have 2 different mode as is the standard in Rust:
Debug
andDisplay
Debug
would try to stay as close as possible to the underlying Wasmi bytecode data structures while being a bit more readable to the user.Display
would optimize on readability and provide a mostly assembly-like reading experience. This could include costly turning branch offsets into labels dividing basic blocks etc.The Wasmi CLI should expose this functionality in some way.
It must be noted that these print representations might change over time and thus are not a choice for (de)serialization.
If the resulting code to support this feature is very large we might want to put this entire functionality behind a crate feature
debug
orprinting
.The text was updated successfully, but these errors were encountered: