sansmoraxz edited PR #15194.
sansmoraxz edited PR #15194:
Follow-up to #15182. A component's core modules share one code image and one frame table, and the frame table told breakpoint sites apart only by their module-relative Wasm PC, so the same PC in two modules was taken for the same site. There are two fixes, one per commit.
Keep inlined breakpoints when single-stepping ends. Since #15182, each module re-patches only the sites in its own range of the code. But with inlining, a function from one module can be inlined into a caller from another. Its sites are then in the caller's range, and were re-patched by the caller's module, so a breakpoint in the inlined function was lost. The frame table now records each site's module (the innermost frame's, so inlined code keeps its own), and re-patching goes by that. This removes the text-range accessors added in #15182: where a site is in the code says whose function it is in, not whose Wasm code it is, and once the frame table records the module the range isn't needed. Re-patching also gets cheaper: it walks only the module's own sites, found by a binary search.
Scope breakpoint lookups to one module. Adding, removing and slipping a breakpoint looked its sites up by PC alone, across all modules. So:
- a breakpoint set in one module also stopped another module at the same PC,
- removing one module's breakpoint also removed another module's at the same PC,
- a breakpoint past the last site of its module slipped to a site in another module.
The sites are now sorted by module, then PC, and each lookup is scoped to one module.
FrameTable::breakpoint_patchesnow takes a module, andobjdumpuses the newall_breakpoint_patches.Tests:
component_inlined_breakpoint_survives_single_stepsets a breakpoint in a function called from another module, with inlining off and on.component_breakpoint_stays_in_its_moduleandcomponent_breakpoint_slips_within_its_modulewithout it, a breakpoint in one module also stops the other, and a breakpoint past module 0's code lands in module 1.TWO_MODULESnow has both functions at the same PCs; the old one, with padding, isTWO_MODULES_PADDED.
github-actions[bot] added the label wasmtime:api on PR #15194.
alexcrichton removed the review request for wasmtime-core-reviewers from PR #15194.
alexcrichton removed the review request for alexcrichton from PR #15194.
alexcrichton requested cfallin for a review on PR #15194.
:thumbs_up: cfallin submitted PR review:
Thanks!
cfallin added PR #15194 Debugging: Keep a component's breakpoints in the module they were set in to the merge queue.
github-merge-queue[bot] removed PR #15194 Debugging: Keep a component's breakpoints in the module they were set in from the merge queue.
alexcrichton added PR #15194 Debugging: Keep a component's breakpoints in the module they were set in to the merge queue.
:check: alexcrichton merged PR #15194.
alexcrichton removed PR #15194 Debugging: Keep a component's breakpoints in the module they were set in from the merge queue.
Last updated: Nov 19 2026 at 20:05 UTC