Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-debug-dev] NOT preserving the Variables View expansion state

> 
> Hello,
> 
> In my custom debugger, I would like to preserve the expansion state 
> of a variable depending on its type in the following scenario. The 
> user hits the same breakpoint repeatedly in a loop. In suspended 
> state, she examines some or all of the variables in the Variables 
> View by expanding a variable children. On the next suspend at the 
> same breakpoint, Variables View tries to reproduce the expansion 
> state of the previous suspension. However, for some variables it may
> be very costly (such as database tables), and in all cases, the 
> expansion of such a variable should only happen when the user clicks
> the + widget for this variable.
> 
> To repeat: depending on the type of the variable, I would like to 
> have it always collapsed in the Variables View, regardless of the 
> previous user's actions.
> 
> 
> Is there a debug platform specific way to achieve this?
> 
> Thanks.
> 

Currently there is no way to do this. The variables view caches expansion 
state per frame (in an LRU cache that holds about 20 states). When a frame 
is re-entered, the corresponding state is restored. Models don't currently 
interact with this (except to create element mementos and compare elements 
to mementos via IElementMementoProvider). 

It's possible that you could avoid re-expanding variables by hacking your 
IElementMementoProvider to always return "false" when comparing. I.e. 
during state restore, you would never admit to having an element that 
matched a memento for a variable that you do not want expanded. (I have 
not tried this, it is just a hypothesis).

Darin Wright


Back to the top