Skip to content

fix(xdebug): keep a breakpoint_resolved that beats its breakpoint_set reply - #402

Merged
butschster merged 1 commit into
masterfrom
fix/xdebug-bp-resolved-race
Nov 7, 2026
Merged

butschster merged 1 commit into
masterfrom
fix/xdebug-bp-resolved-race

Conversation

@butschster

Copy link
Copy Markdown
Member

What

Xdebug sends breakpoint_resolved for an already loaded file together with the breakpoint_set reply. The breakpoint sync learns the engine id only after that reply returns, so the notify matched no breakpoint and was dropped: no resolved_line, no WS breakpoint.resolved event.

  • Unmatched breakpoint_resolved notifies of a session driven by Buggregator are kept per session by engine id (Session.bpEarly, capped at 1000) and applied in setBP once the id is known; the event is emitted then.
  • breakpoint_list read while paused now moves a breakpoint reported resolved="resolved" from unresolved to resolved (xResponse.Breakpoints.Resolved).

Tests

  • TestBreakpoints_ResolvedNotifyWithSetReply — fake engine sends the notify before and after the set reply (×10 each).
  • TestBreakpoints_ListResolves — resolved state taken from breakpoint_list.
  • TestMCPBreakpointTools expectation is now resolved.
  • go test -race -count=1 ./modules/xdebug/ ok; -run Breakpoint -count=10 ok.
  • Not live-checked against a real Xdebug yet.

Made with harnsy

… reply

Xdebug sends breakpoint_resolved for a loaded file together with the
breakpoint_set reply; the sync learns the engine id only after the reply,
so the notify found no breakpoint and was lost (no resolved_line, no
breakpoint.resolved event). Unmatched notifies of a session driven here are
kept by engine id and applied in setBP. breakpoint_list read while paused
also moves an unresolved breakpoint to resolved.
@butschster butschster added the type: bug Something is broken or behaves incorrectly label Nov 7, 2026
@butschster
butschster merged commit 2fb24dd into master Nov 7, 2026
1 check passed
@butschster
butschster deleted the fix/xdebug-bp-resolved-race branch November 7, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Something is broken or behaves incorrectly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant