cfallin requested fitzgen for a review on PR #15185.
cfallin requested wasmtime-core-reviewers for a review on PR #15185.
cfallin opened PR #15185 from cfallin:breakpoint-state to bytecodealliance:main:
In order to prepare for record/replay and reversible debugging, we need a little more discipline about read-only vs. read-write access to the
Store. The breakpoint/watchpoint state in the store is a logically separate thing that has more to do with execution strategy than the actual Wasm state (i.e., cannot affect Wasm state).Also, separately, breakpoints and watchpoints have a somewhat distributed API surface: breakpoints are edited via the existing
Store::edit_breakpointsthat returns aBreakpointEditview struct, while watchpoints are edited viaMemory::debug_watch. Watchpoints are really a kind of breakpoint (if you squint enough) and both should be managed in the same way.This PR introduces a
BreakpointStateview struct in the API returned fromStore::edit_breakpointsthat manages both breakpoints and watchpoints. This solves both problems: we can now treatBreakpointStateas a thing that we can hand out mutably in future record/replay debug APIs (when the overall store is read-only), providing access to exactly and only the bit of execution-control state we want to be mutable.<!--
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 review the Bytecode Alliance's AI tool usage policy at
https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.mdPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
:thumbs_up: fitzgen submitted PR review.
:speech_balloon: fitzgen created PR review comment:
Trailing
boolparameters are not great for readers at call sites. Does it make sense to split this method intowatchandunwatch(or{start,stop}_watching)? Or alternatively the classic approach likeenum WatchAction { StartWatching, StopWatching }but probably/hopefully with better names...
github-actions[bot] added the label wasmtime:api on PR #15185.
cfallin updated PR #15185.
:memo: cfallin submitted PR review.
:speech_balloon: cfallin created PR review comment:
Done! Went with
watchandunwatchhere.
cfallin has enabled auto merge for PR #15185.
cfallin added PR #15185 Debugging: edit breakpoints and watchpoints through BreakpointState. to the merge queue
:check: cfallin merged PR #15185.
cfallin removed PR #15185 Debugging: edit breakpoints and watchpoints through BreakpointState. from the merge queue
Last updated: Nov 19 2026 at 20:05 UTC