Skip to content

Don't lose a component's breakpoints when single-stepping is turned off - #15182

Merged
cfallin merged 1 commit into
bytecodealliance:mainfrom
sansmoraxz:guest_debug_fix
Nov 6, 2026
Merged

cfallin merged 1 commit into
bytecodealliance:mainfrom
sansmoraxz:guest_debug_fix

Conversation

@sansmoraxz

Copy link
Copy Markdown
Contributor

In a component with several core modules, turning single-stepping off removed the breakpoints in all of its modules except the last one.

The modules share one code image. When single-stepping was switched, each module reset every breakpoint site in that shared code by its own list of breakpoints, including the sites belonging to other modules. Whichever module went last decided for all of them.

With this change, each module only resets its own sites.

The test, component_breakpoint_survives_single_step, sets a breakpoint in one of two modules, turns single-stepping on and off, and checks that the breakpoint still fires. Without the fix, a breakpoint in the first module never fires.

@sansmoraxz
sansmoraxz requested a review from a team as a code owner November 6, 2026 16:55
@sansmoraxz
sansmoraxz requested review from pchickey and removed request for a team November 6, 2026 16:55

@cfallin cfallin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread crates/wasmtime/src/runtime/debug.rs Resolved
A component's core modules share one code image and frame table, so
each module re-patched every module's breakpoint sites by its own
breakpoints, and the last one decided for all.

@cfallin cfallin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@cfallin
cfallin added this pull request to the merge queue Nov 6, 2026
Merged via the queue into bytecodealliance:main with commit 5956ebf Nov 6, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants