Skip to content

Debugging: add docs to describe how to perform guest debugging.#13097

Merged
cfallin merged 2 commits intobytecodealliance:mainfrom
cfallin:guest-debugging-docs
Apr 14, 2026
Merged

Debugging: add docs to describe how to perform guest debugging.#13097
cfallin merged 2 commits intobytecodealliance:mainfrom
cfallin:guest-debugging-docs

Conversation

@cfallin
Copy link
Copy Markdown
Member

@cfallin cfallin commented Apr 14, 2026

No description provided.

@cfallin cfallin requested a review from a team as a code owner April 14, 2026 19:55
@cfallin cfallin requested review from fitzgen and removed request for a team April 14, 2026 19:55
Copy link
Copy Markdown
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't necessarily have to be in this PR, but I think it would be fantastic to have two sections in this page:

  1. Using lldb on the command line
  2. Using VSCode as a graphical debugger

And then including screenshots in (2), similar to what we have for the guest profiler. Also (2) should probably come before (1) on the actual page.

Basically, I think this page could use some flash and pizazz (which screenshots and GUIs really help with) to show off all the great work you've done for guest debugging. As it is, this feels a little anti-climactic to me.

Comment thread docs/examples-debugging-guest.md Outdated
Comment on lines +35 to +53
4. Run LLDB, connect and debug.

You'll need a recent version of LLDB (v32 or later) with Wasm
support enabled. The [wasi-sdk] distribution provides such a
build.

```console
/opt/wasi-sdk/bin/lldb
(lldb) process connect --plugin wasm connect://0:1234
Process 1 stopped
* thread #1, stop reason = signal SIGTRAP
frame #0: 0x00000000
error: memory read failed for 0x0
(lldb) b my_function
(lldb) continue
```

and use LLDB like normal, setting breakpoints, continuing and
stepping, examining memory and variable state, etc.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also show setting breakpoints, stepping, and printing variables? Ideally with some kind of actual bug in the Wasm program? I guess this requires using an actual wasm program for the example as well, instead of foo.wasm.

So maybe we have (a) the short+concise steps of setting up guest debugging (flags to enable and all that) and then (b) the slightly longer-form (but it really needn't actually be long, just longer) walkthrough that shows a real program and actually using the guest debugging support to diagnose a (very simple and obvious) bug in it.

Co-authored-by: Nick Fitzgerald <fitzgen@gmail.com>
@cfallin
Copy link
Copy Markdown
Member Author

cfallin commented Apr 14, 2026

Thanks! I'll go ahead and merge this as-is (since it more or less mirrors what we have for native debugging) to have something for 44.0; and we can work on a longer intro/tutorial, maybe including VS Code etc, off the critical path.

@cfallin cfallin enabled auto-merge April 14, 2026 21:00
@cfallin cfallin added this pull request to the merge queue Apr 14, 2026
Merged via the queue into bytecodealliance:main with commit e10bd43 Apr 14, 2026
48 checks passed
@cfallin cfallin deleted the guest-debugging-docs branch April 14, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants