Skip to content

Debugging: add debugger support for wasmtime serve.#12859

Open
cfallin wants to merge 1 commit intobytecodealliance:mainfrom
cfallin:debug-wasmtime-serve-2
Open

Debugging: add debugger support for wasmtime serve.#12859
cfallin wants to merge 1 commit intobytecodealliance:mainfrom
cfallin:debug-wasmtime-serve-2

Conversation

@cfallin
Copy link
Copy Markdown
Member

@cfallin cfallin commented Mar 27, 2026

This adopts a simple solution to #12776: it takes the "instance reuse" paradigm to the extreme, instantiating exactly one instance and serializing all requests into that one instance. This allows the debugger component to operate on one Store, setting breakpoint state and presenting its execution to the attached debugger as a single program execution and minimizing impedance mismatches.

This also adds an integration test that runs an existing wasi-http test component under the debugger.

Contains a few bugfixes to core debug functionality:

  • Give unique names to "libraries" (core Wasm modules) reported in the gdbstub server to the debugger; LLDB otherwise deduplicates all the modules named wasm into one, and gets confused about base addresses and module indices.
  • Use core-module-relative PCs, not component-relative PCs, everywhere.

With these fixes, setting a breakpoint at handle in a wasi-http component and introspecting mid-request works properly.

Closes #12776.

This adopts a simple solution to bytecodealliance#12776: it takes the "instance reuse"
paradigm to the extreme, instantiating exactly one instance and
serializing all requests into that one instance. This allows the
debugger component to operate on one `Store`, setting breakpoint state
and presenting its execution to the attached debugger as a single
program execution and minimizing impedance mismatches.

This also adds an integration test that runs an existing wasi-http
test component under the debugger.

Contains a few bugfixes to core debug functionality:
- Give unique names to "libraries" (core Wasm modules) reported in the
  gdbstub server to the debugger; LLDB otherwise deduplicates all the
  modules named `wasm` into one, and gets confused about base addresses
  and module indices.
- Use core-module-relative PCs, not component-relative PCs, everywhere.

With these fixes, setting a breakpoint at `handle` in a wasi-http
component and introspecting mid-request works properly.
@cfallin cfallin requested review from a team as code owners March 27, 2026 21:29
@cfallin cfallin requested review from fitzgen and removed request for a team March 27, 2026 21:29
@github-actions github-actions bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasmtime:api Related to the API of the `wasmtime` crate itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Debugging: implement debug component support for wasmtime serve

1 participant