Skip to content

fix(#255): correct the continue-re-stop diagnosis — multi-location macro breakpoints - #277

Merged
debugmcpdev merged 2 commits into
mainfrom
fix/255-multi-location-breakpoint-e2e
Aug 6, 2026
Merged

fix(#255): correct the continue-re-stop diagnosis — multi-location macro breakpoints#277
debugmcpdev merged 2 commits into
mainfrom
fix/255-multi-location-breakpoint-e2e

Conversation

@debugmcpdev

Copy link
Copy Markdown
Collaborator

Summary

Validating the Rust trio (#272/#273/#274/#276) on Ubuntu surfaced a failing test on main: the strict non-win32 reproducer added in #274 asserts that one continue_execution from a breakpoint at examples/rust/hello_world/src/main.rs:26 runs the program to completion. It does not, on Linux — but not because of the bug #255 describes.

Root cause

Line 26 is let message = format!("Language: {}, Version: {}", name, version);. The format! expansion inlines several call sites onto that one source line, so LLDB plants a breakpoint location at each — the setBreakpoints response says Resolved locations: 3. Each continue advances to the next location, so the session re-pauses on the same file:line, with the same breakpoint id, at a different program counter. The line takes three continues to leave.

Confirmed with a raw DAP client driving the vendored CodeLLDB directly (mcp-debugger entirely out of the loop):

breakpoint line source resolved locations continues to completion
26 let message = format!(...) 3 3
13 let name = "Rust"; 1 1
42 let sum = a + b; 1 1

Each intermediate stop reports reason: "breakpoint", hitBreakpointIds: [1], line: 26, col: 19 — at PCs …C6FF, …C73A, then termination. Also ruled out the #236 post-stop setBreakpoints re-sync by disabling it: no change.

So this is ordinary LLDB multi-location behavior on every platform — not Windows-specific, not MSVC/PDB-specific, and not ours. The prior "Linux remains clean" note only held because nothing in the suite had ever continued past a user breakpoint on Linux, which is the exact gap #274 set out to close.

Changes

  • tests/e2e/mcp-server-smoke-rust.test.ts — replaces the wrong-premise reproducer with two tests sharing one launch helper, both running on all platforms (the win32 special-casing and its step_over workaround are gone):
    • a single-location line (42) that must complete in exactly one continue — the coverage gap that let this survive;
    • a multi-location macro line (26) that must stay on line 26 between stops, drain its locations within a bound, and then exit 0 in more than one continue.
  • skills/debugging/references/rust.md — the quirk bullet and troubleshooting row described a Windows-only re-hit bug with a step_over workaround; they now describe multi-location macro breakpoints and the correct guidance (keep continuing, or step_over once to cross the whole line).
  • mcp-server-breakpoint-management.test.ts / mcp-server-smoke-restart.test.ts — comments corrected. Behavior deliberately untouched: both already tolerate multi-location stops (one clears breakpoints first, the other loops), and Windows can't be exercised from this machine.

Testing (Ubuntu 24.04, x86_64, CodeLLDB 1.11.8, rustc 1.91.1)

  • mcp-server-smoke-rust 4/4, mcp-server-breakpoint-management 8/8, mcp-server-smoke-restart 8/8
  • Full unit + integration with LEAK_GUARD_STRICT=1: 2852 passed
  • Lint and typecheck clean

Also verified on Linux while here (no changes needed)

Closes #255

🤖 Generated with Claude Code

…cro breakpoints

The strict non-win32 reproducer added in #274 fails on Linux: it asserts that
one continue from a breakpoint at hello_world/src/main.rs:26 runs the program
to completion. Line 26 is `let message = format!(...)`, and the `format!`
expansion inlines several call sites onto that one source line, so LLDB plants
a breakpoint location at each — the setBreakpoints response reports
"Resolved locations: 3". Each continue advances to the next location, so the
session re-pauses on the same file:line with the same breakpoint id at a
different program counter, and the line takes three continues to leave.

Confirmed with a raw DAP client driving the vendored CodeLLDB directly, with
mcp-debugger out of the loop: line 26 needs 3 continues, while single-statement
lines (13, 42) need exactly 1. So this is normal LLDB multi-location behavior
on every platform — not a Windows defect, not symbol-format-specific, and not
ours. The earlier "Linux is clean" note simply reflected that nothing had ever
continued past a user breakpoint on Linux.

- smoke-rust: replace the wrong-premise reproducer with two tests — one
  single-location line that must complete in exactly one continue (the
  coverage gap that let this survive), and one macro line that must drain its
  locations, stay on line 26 in between, and then complete. Both run on all
  platforms; the win32 special-casing is gone.
- rust.md: rewrite the #255 quirk and troubleshooting row to describe
  multi-location breakpoints instead of a Windows-only re-hit bug.
- breakpoint-management / smoke-restart: correct the comments on their
  step_over calls; behavior left alone since Windows can't be tested here.

Refs #255
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@debugmcpdev

Copy link
Copy Markdown
Collaborator Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Verified on the platform this PR could not exercise: all 4 tests in tests/e2e/mcp-server-smoke-rust.test.ts pass on Windows 11 (GNU toolchain, CodeLLDB 1.11.8) — the single-location line-42 test completes in exactly one continue, and the line-26 macro test drains its locations and exits 0. This confirms the diagnosis on Windows: the re-stop follows breakpoint-location count, not the OS.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

…gnosis

- smoke-rust: retire the leftover "Windows re-hits the breakpoint on
  continue" parenthetical in scenario A — the no-continue rationale now
  points at the multi-location drain the new test below pins.
- breakpoint-management: the step-6 guard comment attributed the win32
  step_over to multi-location resolution, but all breakpoints are
  cleared (count asserted 0) at that point — it actually guards the
  removal-sync race the header docblock describes.
- rust.md: note that a line's location count is toolchain-dependent
  (same format! line: 1 location under rustc 1.83, 3 under 1.91),
  reconciling issue #255's 2026-08-04 Linux single-continue experiment
  (docker rust:1.83) with the 3-location Ubuntu validation (rustc 1.91).

Windows leg verified for this PR: all 4 smoke-rust tests pass on
Windows 11 / GNU / CodeLLDB 1.11.8, including single-continue at the
single-location line.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@debugmcpdev
debugmcpdev merged commit 41df891 into main Aug 6, 2026
9 checks passed
@debugmcpdev
debugmcpdev deleted the fix/255-multi-location-breakpoint-e2e branch August 6, 2026 14:57
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.

Rust/Windows: continue_execution re-stops at the same breakpoint (never advances without a step_over)

2 participants