Stream: general

Topic: debugging wasm bytecode


view this post on Zulip tabun dareka (Nov 23 2023 at 04:07):

Hey folks, im new to wasm/wasi so sorry if this is not the right place...
I wanted to play a little with it, debug the wasm bytecode and what not, so i set up gdb according to the docs and this is what i got:
image.png
It shows me the source code, which is fine, but what I want instead is that I want to inspect the wasm execution environment like see the wasm stack (if it has one), see the wasm bytecode instructions, etc, etc. Is this possible and if so how?

view this post on Zulip Alex Crichton (Nov 23 2023 at 06:22):

I don't think we have the dwarf right now to perform debugging like that unfortunately

view this post on Zulip Ralph (Nov 23 2023 at 09:03):

We're working on a dwarf wasm debugger extension here: https://marketplace.visualstudio.com/items?itemName=ms-vscode.wasm-dwarf-debugging. But we note in the repo that Rust does not yet produce the proper dwarf due to https://github.com/rustwasm/wasm-bindgen/issues/2389 where I notice that this bug has been fixed!! ooooo I'll give that a try.

Extension for Visual Studio Code - Enables enhanced WebAssembly debugging
The Visual Studio Code editor includes Node.js debugging support. Set breakpoints, step-in, inspect variables and more.
Motivation Chrome, Firefox and now also Sentry support DWARF for WebAssembly as debug format. In particularly for crash reporting systems like Sentry DWARF is a very important tool to create accura...

view this post on Zulip Ralph (Nov 23 2023 at 09:10):

this may not yet drop into the bytecode, but it will....

view this post on Zulip tabun dareka (Nov 23 2023 at 10:15):

I see, thanks!

view this post on Zulip Ralph (Nov 23 2023 at 10:46):

if you try that, and it doesn't do what you'd like, let us know. tag me in the repo: @squillace.


Last updated: Nov 22 2024 at 16:03 UTC