-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Single step in debugger collapses all variables being watched #25652
Comments
@o-lim Which extension do you use for debugging ? |
I use the Microsoft C/C++ extension |
Please file this issue against the C/C++ extension. |
@weinand: According to the guys at vscode-cpptools, this is a VSCode issue. See microsoft/vscode-cpptools#677 |
@isidorn any insights? |
@weinand I don't think the protocol allows for me to say that it should be expanded when I return the evaluation value. Any ideas? |
The expansion state of a Variable or Watch tree is preserved across steps if the @pieandcakes no, the protocol for Variable access does not allow to specify the expand state for evaluation values. But I do not see how this would help to solve this issue: the debug adapter should not have to care about the expansion state of the tree. This is only VS Code's business. |
@weinand how do you implement keeping the |
I have just checked the code on the vscode side I confirm what @weinand commented. Some more details: And yes the protocol should not touch upon tree expansion so the C++ extension should try to make the references stable where it makes sense |
@gregg-miskelly one of the reasons why vscode also uses the reference when determing the id is that there were cases when there are mutliple varialbes with the same name in the same "scope". Even though this is illegal. We have to prevent that as having two elements with the same ID seriously breaks the tree. An alternative would be that vscode filters variables it recieves by name uniqness and then only uses tha |
@isidorn How do you implement this in other debug adapters? Ex: Do you have a Dictionary? Or do you just get lucky? In the case of the C++ and C# debug adapters, reference numbers are just calculated with a simple counter. So the first thing that VS Code asks for that needs a reference during a particular break state session will be I understand how multiple variables of the same name makes this more complicated, but I would suggest using name+child_number/local_number rather than reference. |
@gregg-miskelly no, we don't use dictionaries. The node DA resets the counter whenever entering break state (stopped event). |
@weinand So don't you have the same problem then? Or am I missing something. Theoretical repro steps:
|
When stepping over an instruction, any expanded variables in the watch window are automatically collapsed, force the user to to expand any variable of interest to view it's contents. This is particularly annoying when you need to observe how a nested variable (2 or more levels deep) is updated across several lines of code.
The text was updated successfully, but these errors were encountered: