4 ms·
Loving the tooling around wasm getting better. I've been debugging my compiler output with hexl-mode and reading the binary format and while it's not that bad,
by _hardwaregeek 6y ago
Loving the tooling around wasm getting better. I've been debugging my compiler output with hexl-mode and reading the binary format and while it's not that bad, it'd be nice to do more advanced debugging with a text format.
There was a project I saw too that intended to visualize WebAssembly's execution. That'd be extremely helpful too
- cfallin 6y ago> reading the binary format ... it'd be nice to do more advanced debugging with a text format. Do you know about `wasm2wat` (from the WebAssembly binary toolkit, "WABT")? It produces a 1-to-1 text representation of the bytecode and is meant to always roundtrip via `wat2wasm` back to the same bytecode.
- _hardwaregeek 6y agoYeah...I should probably use that. But does it work on mangled WASM? Part of the issue was that my compiler wasn't producing valid WASM
- cfallin 6y agoAh, no, probably doesn't do parsing recovery. But `wasm-validate` from the same toolkit will at least tell you the offset at which your wasm file has an error (I just flipped some bits in a wasm file to test this), which may be helpful!