fix(#468): get_local_variables walks down past an empty runtime top frame - #482
Merged
Conversation
…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 Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #468.
get_local_variableshard-anchored tostackFrames[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'sframefield names the anchored frame, and a newnotesays 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, andnotFoundreports it.Verification
sleep_fortop frame +mainwithcounterone down): walk-down findscounter,framereportsmain,notediscloses; and the names-filter case stays anchored to the top.pause_executionanchors to LLDB's injectedDbgBreakPointthread, whose whole stack is synthetic — that is sibling issue Java attach anchors to a frameless thread — session reports paused but is uninspectable, and the suggested recovery isn't possible with existing tools #465's shape (thread anchoring, not frame anchoring). The Java attach anchors to a frameless thread — session reports paused but is uninspectable, and the suggested recovery isn't possible with existing tools #465 fix composes with this one; live verification of the pair happens there.Relates to #369, #465.
🤖 Generated with Claude Code