Skip to content

service/dap: honor the frame and goroutine of the SetVariable scope - #4419

Open
larrasket wants to merge 1 commit into
go-delve:masterfrom
larrasket:fix-3171-setvariable-frame
Open

service/dap: honor the frame and goroutine of the SetVariable scope#4419
larrasket wants to merge 1 commit into
go-delve:masterfrom
larrasket:fix-3171-setvariable-frame

Conversation

@larrasket

Copy link
Copy Markdown
Contributor

onSetVariableRequest hardcoded goid, frame := -1, 0, setting a local in a non-top stack frame is either: failed to find the variable or silently mutated the same-named local in frame 0.

Carry the scope's goroutine and frame index on the variable handle, propagate them to child handles, and use them in onSetVariableRequest.

Fixes #3171

onSetVariableRequest hardcoded goid, frame := -1, 0, so setting a local in
a non-top stack frame either failed to find the variable or silently
mutated the same-named local in frame 0. The sibling scopes/evaluate/
setDataBreakpoint handlers already thread frame context from the handle;
only setVariable did not.

Carry the scope's goroutine and frame index on the variable handle,
propagate them to child handles, and use them in onSetVariableRequest.

Fixes go-delve#3171
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.

Setting a variable on an upper frame using DAP fails

1 participant