Skip to content

fix(#468): get_local_variables walks down past an empty runtime top frame - #482

Merged
debugmcpdev merged 3 commits into
mainfrom
fix/468-locals-frame-anchor
Aug 25, 2026
Merged

fix(#468): get_local_variables walks down past an empty runtime top frame#482
debugmcpdev merged 3 commits into
mainfrom
fix/468-locals-frame-anchor

Conversation

@debugmcpdev

Copy link
Copy Markdown
Collaborator

Closes #468.

get_local_variables hard-anchored to stackFrames[0], so a pause inside a blocking syscall (the normal state of any long-running program) returned an empty array while the user frame's locals sat one frame down — already fetched by the #438 scope fan-out and then discarded.

Fix

Extraction is now parameterized by anchor: policies anchor to the head of the frame list they receive, so extractAt(stackFrames.slice(k)) re-anchors them without touching any policy. When frame 0 yields nothing, the tool walks down to the first frame that does — zero additional DAP round-trips, exactly as the issue proposed. The response's frame field names the anchored frame, and a new note says the walk-down happened, so the caller is never silently shown a different frame's data.

Under an explicit names: filter the walk-down is skipped — "nothing matched in the top frame" is the honest answer there, and notFound reports it.

Verification

Relates to #369, #465.

🤖 Generated with Claude Code

…rame

A pause inside a blocking syscall/sleep puts a stdlib frame with no
locals at stackFrames[0]; the tool returned an empty array even though
the user frame's locals were one frame down and already fetched (the
scope fan-out from #438 collects every frame).

Extraction is now parameterized by anchor frame: when the top frame
yields no locals, walk down to the first frame that does (policies
anchor to the head of the frame list they receive, so slicing
re-anchors them — zero extra DAP round-trips). The response's `frame`
names the anchored frame and a `note` discloses the walk-down.

Skipped under an explicit `names` filter, where "nothing matched in the
top frame" is the honest answer (notFound reports it).

The Windows live repro (cpp pause) anchors to LLDB's injected
DbgBreakPoint *thread*, which is the sibling issue #465's shape —
thread-level adoption lands there and composes with this fix.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.12500% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/session/session-manager-data.ts 80.00% 6 Missing ⚠️
src/server.ts 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@debugmcpdev
debugmcpdev merged commit 963d170 into main Aug 25, 2026
8 of 9 checks passed
@debugmcpdev
debugmcpdev deleted the fix/468-locals-frame-anchor branch August 25, 2026 00:20
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.

get_local_variables anchors to stackFrames[0] — returns empty on a syscall pause after already fetching the user frame's locals

2 participants