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
Variables window collapses all expanded nodes after a Step/Step-Over/Continue #76427
Comments
@haneefdm Thanks for the detailed analysis and for the potential fix. How we could potentially fix this:
Feel free to open a PR with this appraoch and we can try it out and see if it fixes your issue. |
@isidorn, Thanks for the quick reply. Yes, I considered using I will implement the But, may I ask for one change from your proposal. The last bullet says, 'clear the tree when running state happens'. May I suggest we not do that instantly. The current method of waiting for 400ms has a nice visual effect of not clearing the window and then repainting it. Causes flashing. 400ms is a nice enough time because the user won't have time to interact with the tree while it is invalid and lots of times, it debugger stops. I will implement without losing the current nice feature of not flashing ... unless you insist. |
Yes, your correction sounds good to me. You can sketch up a PR and we can take it from there if it looks good. Thanks! |
@isidorn, I created a PR #76476 using the FYI, I was working with the MIEngine folks to add a feature to MIEngine (registers scope) and ran into this during my testing. I made sure all variable IDs were the same and I was still losing tree state. If accepted, it will help a lot. |
Thank you for the PR I will review it later today. |
Fixed via #76476 |
@haneefdm once the new insiders is out tomorrow please let me know if you can still reproduce the original issue. |
Will do and report back. |
Done. It works as expected in today's insiders build and the original issue is no more. |
Great, adding verified label. |
Issue Type: Bug
This is a continuation of Issue #25652. Since it is closed for comments, creating a new one here.
I have a way to demonstrate the problem and a fix for it as well. It is not specific to cpptools/MIEngine. I can show the problem with Typescript debugging as well. The problem happens when you go from a stopped->running->stopped transition of a program. Not specific to step/next/continue actions and not specific to a particular debug-adapter/language.
As mentioned in issue #25652, it is true that
variableReferences
must be preserved by the debug adapter for the state to be preserved. I verified that MIEngine does indeed conform, all references are the same as before. This problem only happens if the elapsed time from a running->stopped transition is more than about a half a second.When going from a stopped->running transition, the variable window gets a
onDidFocusStackFrame
event -- but call-stack is empty. In the event handler, an actual tree update is scheduled with a delay of 400ms. If a new stackFrame is available by the time the update function is called, then it has a stack frame and will update the tree nicely. But by the time the update function is called we still don't have a valid stack frame (a running->stopped transition has not occurred yet), then the children are destroyed and the tree becomes empty. Eventually, when a running->stopped transition does occur, it all looks new and the tree gets its default state (the first scope expanded). Lost state.I have two examples that you can get from https://github.com/haneefdm/cortex-debug-samples
There are two subdirectories of interest:
see
main.cpp
for instructions on where to set breakpoints and what to dosee
src/main.ts
for instructions on where to set breakpoints and what to doI have a fix in my fork, and I hope someone can review my changes (just one file)
https://github.com/haneefdm/vscode/blob/master/src/vs/workbench/contrib/debug/browser/variablesView.ts
My changes are at the beginning of the
VariablesView.constructor()
and beginning ofVariablesView.renderBody()
. The Variable window also behaves differently on different OSes and speed of the machine.I welcome any other fix, but this is a big problem and it becomes very obvious/painful when debugging remotely or anything complicated with complex data structures.
VS Code version: Code 1.35.1 (c7d83e5, 2019-06-12T14:29:22.216Z)
OS version: Darwin x64 18.6.0
System Info
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Extensions (22)
The text was updated successfully, but these errors were encountered: