cfallin opened PR #12663 from cfallin:debugging-the-module-registration-single-step-dance to bytecodealliance:main:
We currently do a store-wide state-change on all registered modules when the "single stepping" flag changes, patching in or out all breakpoints. However, this design didn't account for modules registered with the store after single-stepping is enabled (and new modules may be registered any time an instantiation occurs). In particular this is problematic when a debugger, e.g., sets the single-step flag right at the beginning of execution of a "host main function" that calls Wasm, before the main instantiation occurs.
This PR threads through the breakpoint state in the registration path, with the narrow waist at
ModuleRegistry::registerwhich is the only place where modules are added to theLoadedCode.<!--
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 #12663.
cfallin requested wasmtime-core-reviewers for a review on PR #12663.
cfallin unassigned fitzgen from PR #12663 Debugging: apply single-stepping patches to modules instantiated after setting changes..
cfallin requested alexcrichton for a review on PR #12663.
alexcrichton submitted PR review.
alexcrichton added PR #12663 Debugging: apply single-stepping patches to modules instantiated after setting changes. to the merge queue
alexcrichton merged PR #12663.
alexcrichton removed PR #12663 Debugging: apply single-stepping patches to modules instantiated after setting changes. from the merge queue
Last updated: Mar 23 2026 at 16:19 UTC