[Debugger] Handle previous value save/restore more intelligently
|Reported by:||anevilyak||Owned by:||anevilyak|
Currently, VariablesView saves and restores its view state on every frame change, including those triggered by simply selecting a different frame in the same stack trace. However, while this is necessary in order to ensure that things like selected formats and expanded nodes are preserved, it has an undesired side effect, namely that it also overwrites the previous saved values of those nodes. Consequently, after switching back to the frame, it will no longer show the value changes that it did just before.
We need to detect this situation and not update the saved values in such a circumstance, only doing so when the thread in question has actually resumed execution. A simple solution may be to check if the frame is being changed from one non-null value to another, as we normally clear the frame when execution continues.