DAP Scopes aren't being updated after a variable has changed
See original GitHub issueDescribe the bug
variables
command on scopes’ variablesReference
is not updated if the values of the variables had changed (For example, watch evaluation or variable set). It does work however on an object’s variablesReference
and the bug is specific to scopes.
To Reproduce
Reproducing with setVariable
is tougher and requires sending DAP packets by hand (When setting a variable, VSCode doesn’t fetch the entire variables but uses the returned result from the setVariable
request), but the easiest way would be the following using VSCode watches:
- Debug the following code:
let a = 1
let b = 2
let c = 3
let d = {"m_1":1, "m_2":2}
console.log("Hello world!\n") // <= Place breakpoint here
- Place a single watch:
eval("a = 8")
- see that it doesn’t update the value ofa
. - Place another watch:
eval("d.m_1 = 20")
- see that it indeed updates! - Behind the scenes: After evaluating a watch, VSCode requests again for the scopes and variables of the current frame, upon which
a
returns with the un-updated value whiled.m_1
is.
Log File
No log file is required, as it is easy to reproduce.
VS Code Version: 1.72.0
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Support for indicating custom debug focus change · Issue #128
A client cannot use this event to track any runtime changes of a variable. The event only says that the current "snapshot" of...
Read more >Debug Adapter Protocol - Microsoft Open Source
Debug adapters can use this event to indicate that the contents of a memory range has changed due to some other request like...
Read more >Scope value not updating when service variable changes
I've a component (parms-bar.component.js) which is supposed to update when I click on the button (box.component.js), but it's not happening. I'm ...
Read more >Debugging
Debugging. The Go extension allows you to launch or attach to Go programs for debugging. You can inspect variables and stacks, set breakpoints, ......
Read more >[vscode-go] docs/dlv-dap: add features and images
+To opt in to use this new adapter (`dlv-dap`), add the following in ... variables, setting breakpoints, and other activities that aren't ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, indeed. They have responded positively to the new issue though.
@connor4312 Seems to be a wontfix… https://bugs.chromium.org/p/chromium/issues/detail?id=874865