-
-
Notifications
You must be signed in to change notification settings - Fork 112
Debugging WASM code
Marc Durdin edited this page Mar 10, 2023
·
2 revisions
Very quick notes on using Chrome Dev Tools + NodeJS to debug wasm versions of Core and kmcmplib:
- Do a debug build (see #8393 for how debug builds can be setup to support debugging)
- Install C/C++ DevTools Support (DWARF) Chrome extension, per https://developer.chrome.com/blog/wasm-debugging-2020/
Run node --enable-sourcemaps --inspect-brk <cmdline>
- In Chrome, open chrome://inspect, then open the node inspector when it is listed.
- In order to set breakpoints in the C++ code, you will need to break on the C++
main()
entry point in the js bootloader. The location of this can vary so YMMV, but look formain
.
Then, it "should just work".
Refs: