You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow enumeration of variables without fetching values #564
We are currently investigating features for a debugger for embedded applications that would significantly benefit from mechanisms to enumerate global variables and file static variables of a C/C++ program. Maybe also functions in future.
A lot of what we'd need is already available with variables requests. But I can't find a way to explicitly configure to skip fetching the variable value. This would be important for our embedded use case. We often see applications with lots of global variables. But more importantly, even a moderate number of global variables can mean many target accesses which can be expensive and impact performance if you are using a JTAG debugger.
Would a new VariablesArguments property to skip reading values make sense? Or an entirely new API function for symbol/variable enumeration without fetching values?
Also, thinking about the huge number of global variables that can be returned, it could make sense to put them into a Scope that has a flag marking it as "do-not-show" in a variables window/GUI. Navigating the huge number of variables may not be practical. But you may still want to list them and their properties in other views and send them for example to a Watch window.
I was briefly thinking into the direction of using a language server for the enumeration. But in our experience, you better rely on the debugger/debug adapter to be the single source of truth of what really exists in the debug information/symbol tables of the debugged application.
lazy in the VariablePresentationHint allows for exactly this. In VS Code for example, this is what the treatment look like (in the JS debugger for objects with getters)
Let me have another look in the new year. I may still miss some hints to connect the dots, hence sharing my initial thoughts:
VariablePresentationHint is part of the response, not the request. In my use case, I would not want the (global) variables to really show in the standard Variables view. The sheer number would make the view difficult to use.
I'd rather would like to have the list displayed/processed in a custom view/view element/data engine. Hence, the original idea of making the behavior change based on a request argument. An example could be a kind of "Symbols" or "Globals" view specifically designed for navigating this number of entries and different functionality than the Variables view.
The additional request argument would also allow to get more details about scope/variable children w/o target access for variables that are shown in the Variables view but not expanded yet. And without the extra lazy load button and click for normal user interaction.
I do however see now that the focus of achieving the above should probably rather be on the scope's presentationHint. All variables under an enumeration scope would be lazy and not access the target during enumeration.
I know this is probably now rather a VS Code question and I'll look this up after the holiday season, but would there be a scopepresentationHint to make them invisible in the Variables window?
Activity
connor4312 commentedon Dec 18, 2025
lazyin theVariablePresentationHintallows for exactly this. In VS Code for example, this is what the treatment look like (in the JS debugger for objects with getters)Let me know if you have questions
jreineckearm commentedon Dec 19, 2025
Thanks for the response, Connor Peet (@connor4312) .
Let me have another look in the new year. I may still miss some hints to connect the dots, hence sharing my initial thoughts:
VariablePresentationHintis part of the response, not the request. In my use case, I would not want the (global) variables to really show in the standard Variables view. The sheer number would make the view difficult to use.lazyload button and click for normal user interaction.scope'spresentationHint. All variables under anenumerationscope would belazyand not access the target during enumeration.scopepresentationHintto make them invisible in the Variables window?