Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: DWARF debugging #194071

Closed
2 tasks done
connor4312 opened this issue Sep 25, 2023 · 0 comments
Closed
2 tasks done

Test: DWARF debugging #194071

connor4312 opened this issue Sep 25, 2023 · 0 comments

Comments

@connor4312
Copy link
Member

connor4312 commented Sep 25, 2023

Refs: microsoft/vscode-js-debug#1789

Complexity: 4

Create Issue


js-debug can now understand DWARF debug symbols that are present in WebAssembly files.

Getting shrunk DWARF

  1. Install nightly
  2. Have some WebAssembly code compiled with Emscripten. I've compiled this repo into WASM files here: emscripten-debug-stories-dist.zip Otherwise you can use this Docker container to help https://hub.docker.com/r/emscripten/emsdk
  3. Run npx serve and Debug: Open Link on localhost:3000 to debug it (you can save this to a launch config for easy access later)
  4. Find a way to step into some WebAssembly. For example, set a breakpoint inside printChar in fibonacci.js, navigate to localhost:3000/fibonacci.html, and select a few callframes up
  5. Verify you step into decompiled WebAssembly and see the prompt for installing the DWARF extension. Accept the install.

Debugging

  1. Stop and start a new debug session. Set a breakpoint in fibonacci.c, or any other c/cc file in that folder
  2. Verify the breakpoint binds when you're on the page that loads that folder
  3. Note: parsing of DWARF symbols is async and we currently cannot ask the browser to pause for us to set breakpoints, so some breakpoints may not be hit when you first go to a page. However, they should be hit on refresh.
  4. Verify you can step around, see variables, and things generally make sense.
    • Try a few different examples in that repo/zip and see how they work.
    • Verify the command to enable and disable "sourcemap stepping" toggle whether you step in the assembly or source code
    • Variables are not directly editable, however you can open memory view and edit memory using the hex editor
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants