Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-debug-dev] Multiple variables views

Hi,

I'm working on an eclipse plugin to add some functionality to the
Variables view. What I'd like is to be able to double-click an object /
struct / array / pointer in the variables view and have just that item
open into a new view, and have it persist over context changes.
(Apologies if this is not the place I should be posting this...)

I started by extending the ExpressionView, and adding a double-click
action to the standard VariablesView to show a new instance of my new
view with the contents of the variable that was double clicked.

Nasty problem #1:
Using an IVariable as the input to the viewer means 1) the display
doesn't update, and 2) if a stack frame is added to the stack (i.e. you
hit resume or step into a function), the variable becomes 'stale'
(despite the very same variable actually still being in scope in some
frame on the stack :-).

Working around this, I decided to use an IWatchExpression as the input
to the viewer. That has the nice property that so long as it's evaluated
only in the right context, it doesn't become stale. But it does mean if
you try to double-click a variable in the new view that isn't in the
currently selected stack frame, it gets evaluated in the wrong context.

I found a way to switch the input between an IVariable and an
IWatchExpression whenever the context changes (giving the best of both
worlds, but the problems of neither), but this is obviously undesirable
and results in Nasty Problem #2:

Resetting the input of the viewer collapses the entire tree. Storing the
value of getExpandedTreePaths() and then restoring it after switching
the input doesn't help either: the IVariable objects in the two
different model trees are actually different objects. Defining a custom
IElementComparer object for the viewer doesn't seem to help either.

Is there anything else I can do to achieve this goal (other than wait
for Pawel's Multi-context proposals to be realised :-) ?

Tom



Back to the top