3 ms·
In 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,
by jitl 2y ago
In 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