sansmoraxz opened PR #15194 from sansmoraxz:guest_debug_single_step_by_module to bytecodealliance:main:
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. The text-range accessors added in #15182 are no longer needed and are removed.
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.
Note: breaking change
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.
sansmoraxz removed the review request for wasmtime-compiler-reviewers from PR #15194.
sansmoraxz requested alexcrichton for a review on PR #15194.
sansmoraxz requested wasmtime-compiler-reviewers for a review on PR #15194.
sansmoraxz requested wasmtime-core-reviewers for a review on PR #15194.
Last updated: Nov 19 2026 at 20:05 UTC