Skip to content

Dev: Wasm Debug

Pablo Mayrgundter edited this page Oct 15, 2024 · 6 revisions

WASM Debugging

It is possible, using the latest Chrome Canary, to set breakpoints and view runtime scoped C++ variables from Conway-Geom while debugging via Share.

Machine Configuration

  1. Install Chrome Canary

  2. Install C++ Devtools Support (Restart Chrome Canary after installation)

  3. Clone conway, conway-web-ifc-adapter, and share

  4. Install dependencies for the above and build.

Link Local Packages

We can link local packages to share, so when we make a change in conway (or specifically conway-geom) and build share, we can set breakpoints and view runtime variable values in our C++ source.

yarn link basically advertises that the package listed in package.json is available locally, for any other package that wants to use it, and a corresponding yarn link <that package> will then use it instead of downloading.

  1. From the conway root:
yarn link
yarn build
yarn build-profile-conway_geom-web
  1. From the conway-web-ifc-adapter root:
yarn link @bldrs-ai/conway
yarn build
yarn link
  1. From share root:
yarn link @bldrs-ai/conway-web-ifc-adapter
yarn build-conway-debug
yarn serve

Now that the packages are linked, navigate to share in Chrome Canary and open developer tools. From there, you can find the wasm C++ source files you want to debug, set break points, and view runtime variables.

Screenshot 2024-10-15 at 3 11 17 PM

You can run yarn unlink in the conway and conway-web-ifc-adapter repos when you are finished to point back to the installed npm packages in share.

Clone this wiki locally