sansmoraxz opened PR #15270 from sansmoraxz:dbg-scope-mod to bytecodealliance:main:
In a component, all the core modules share one frame table. When setting or removing a breakpoint, Wasmtime looked up breakpoint sites by PC alone, and PCs are relative to each module. So if two modules had code at the same PC:
- setting a breakpoint in one module also stopped the other
- removing a breakpoint from one module also removed the other's
- a breakpoint with no later opcode in its own module could slip into another module's code
#15182 and #15194 fixed this for single-stepping by skipping other modules' sites.
This PR fixes it in the frame table itself:
- Breakpoint sites are now sorted by module, then PC, instead of by PC only.
- Every lookup (set, remove, slip, single-step) first narrows to the requested module's range of sites.
The existing two-module component test was padded so the modules' PCs never overlapped, which hid the bug. It now has both modules use the same PCs, and there are new tests for setting, removing and slipping breakpoints in one module without affecting the other.
sansmoraxz removed the review request for wasmtime-compiler-reviewers from PR #15270.
sansmoraxz requested cfallin for a review on PR #15270.
sansmoraxz requested wasmtime-compiler-reviewers for a review on PR #15270.
sansmoraxz requested wasmtime-core-reviewers for a review on PR #15270.
github-actions[bot] added the label wasmtime:api on PR #15270.
:thumbs_up: cfallin submitted PR review:
Thanks very much for this fix!
cfallin added PR #15270 Keep breakpoints in the module they were set in to the merge queue.
:check: cfallin merged PR #15270.
cfallin removed PR #15270 Keep breakpoints in the module they were set in from the merge queue.
Last updated: Nov 19 2026 at 20:05 UTC