3 ms·
How do you debug WASM modules that are running in a host program?
by Jyaif 2y ago
How do you debug WASM modules that are running in a host program?
- 4ad 2y agoPoorly. The tooling is very bad. But to be fair, this is not specific to Go.
- arccy 2y agothe one true debugging method: printf debug
- jitl 2y agoIn v8 environments like browser or node, source maps work, so if you inject console.trace you can get printf debugging w/ legible stack traces on each log line, at least that’s my experience with c code compiled with Emscripten. According to this 2020 blog post from Google, the Chrome debugger appears to have pretty full featured support for interactive debugging, although I’ve never needed to use it. https://developer.chrome.com/blog/wasm-debugging-2020 https://developer.chrome.com/blog/wasm-debugging-2020
- smetannik 2y agoUnfortunately Go doesn’t support exporting DWARF for WASM atm, so printf is the only option. https://github.com/golang/go/issues/33503 https://github.com/golang/go/issues/33503