So, I managed to get something working. I installed:
- Node v11.4
- Chrome beta 71 (because of this)
And launched the node process with node --inspect
, for attaching the Chrome DevTools.
Moreover, in my code, instead of doing WebAssembly.instantiate
in one shot (supplying directly the bitcode), I do it in two steps: WebAssembly.compile
first, and then WebAssembly.instantiate
. As soon as compile
gets executed, there are some "wasm" sources being made available in the DevTools. This is the WebAssembly in wast
text form, in which breakpoints can be set before it gets executed by instantiate
.
But you can't debug from the original C-source files, Chrome DevTools only shows the decompiled wast yet. This feels like the stone age of debugging, but it is still possible to debug.
Edit 2020: This article https://developers.google.com/web/updates/2019/12/webassembly seems to indicate you should now be able to debug in devtools, from the original C source files. I did not try it, though.