cfallin opened PR #12859 from cfallin:debug-wasmtime-serve-2 to bytecodealliance:main:
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
wasminto 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
handlein a wasi-http component and introspecting mid-request works properly.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
cfallin requested fitzgen for a review on PR #12859.
cfallin requested wasmtime-compiler-reviewers for a review on PR #12859.
cfallin requested wasmtime-core-reviewers for a review on PR #12859.
cfallin edited PR #12859:
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
wasminto 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
handlein a wasi-http component and introspecting mid-request works properly.Closes #12776.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
github-actions[bot] added the label wasmtime:api on PR #12859.
fitzgen submitted PR review:
LGTM -- maybe we should have newtypes for offset in code module, vs offset in component, vs offset in code section? Doesn't need to block this PR landing.
cfallin updated PR #12859.
cfallin updated PR #12859.
cfallin commented on PR #12859:
Good idea -- did the newtype thing and pulled out the underlying fixes from this PR as #12901; only last commit is the
wasmtime servebit now.
cfallin updated PR #12859.
cfallin updated PR #12859.
cfallin updated PR #12859.
cfallin commented on PR #12859:
Rebased out the other fixes so now this is just
wasmtime serve -g-- should be ready for review!
cfallin commented on PR #12859:
(@fitzgen you had written "LGTM" above but no r+ -- fyi, but no rush)
fitzgen submitted PR review:
oh whoops sorry!
fitzgen added PR #12859 Debugging: add debugger support for wasmtime serve. to the merge queue
github-merge-queue[bot] removed PR #12859 Debugging: add debugger support for wasmtime serve. from the merge queue
cfallin added PR #12859 Debugging: add debugger support for wasmtime serve. to the merge queue
cfallin removed PR #12859 Debugging: add debugger support for wasmtime serve. from the merge queue
cfallin merged PR #12859.
Last updated: Apr 13 2026 at 00:25 UTC