Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Rendering IVariable in red
Rendering IVariable in red [message #284338] Thu, 21 April 2005 09:10 Go to next message
Eclipse UserFriend
Originally posted by: Daniel.Hirscher.innovations.de

Hi,

I'm writing an own debugger. Everything is fine, except the variables
view rendering changed values in red, which does not work for me.

I'm caching my IValue values in IVariable as JDI does.
I'm caching my IVariables (sub variables) in my Value object, as JDI does.

The variable view contains a variable which itself contains some other
variables, like this:

-+ parameters
+- parameter 1
+- parameter 2

When I step through my suspend counter increments.
But the variables view collapses the "parameters" container variable.
I expect this not to be happen!
Why and where are my Variables are thrown away.

Do I have to cache the stackframes?
Do I have to transfer some sort of state between my debugTarget and the
program under debug?

What is the last secret to get it working?

I read the slides from the eclipse con 2005 debug tutorial which I found
is very good, but the red flag is not included in the examples.
BTW: when to expect the book to be available?

Daniel
Re: Rendering IVariable in red [message #284379 is a reply to message #284338] Fri, 22 April 2005 05:18 Go to previous message
Eclipse UserFriend
hi daniel,

the key method is boolean IVariable.hasValueChanged()

it is used by VariablesViewDecoratingLabelProvider (part of the eclipse
debug ui plugin) which paints each variable.

the getForeground snippet of VariablesViewDecoratingLabelProvider:
....
public Color getForeground(Object element)
{
if (element instanceof IVariable)
{
IVariable variable = (IVariable) element;
try
{
if (variable.hasValueChanged())
{
return
DebugUIPlugin.getPreferenceColor(IDebugPreferenceConstants.C HANGED_VARIABLE_COLOR);
}
}
catch (DebugException e)
{
DebugUIPlugin.log(e);
}
}
return super.getForeground(element);
}
....

in my debugger after suspension of the debugged process i compare the
new stackframes with the old ones and check everything which was before
there and changed. in other words your ivariable impl has to take care
that method hasValueChanged() returns the right thing.

hope this helps.

regards,

lars gersmann


Daniel Hirscher wrote:
> Hi,
>
> I'm writing an own debugger. Everything is fine, except the variables
> view rendering changed values in red, which does not work for me.
>
> I'm caching my IValue values in IVariable as JDI does.
> I'm caching my IVariables (sub variables) in my Value object, as JDI does.
>
> The variable view contains a variable which itself contains some other
> variables, like this:
>
> -+ parameters
> +- parameter 1
> +- parameter 2
>
> When I step through my suspend counter increments.
> But the variables view collapses the "parameters" container variable.
> I expect this not to be happen!
> Why and where are my Variables are thrown away.
>
> Do I have to cache the stackframes?
> Do I have to transfer some sort of state between my debugTarget and the
> program under debug?
>
> What is the last secret to get it working?
>
> I read the slides from the eclipse con 2005 debug tutorial which I found
> is very good, but the red flag is not included in the examples.
> BTW: when to expect the book to be available?
>
> Daniel
Previous Topic:Floating view - is it possible ?
Next Topic:How to reference plugins in closed project in Eclipse IDE
Goto Forum:
  


Current Time: Fri Sep 26 18:51:10 EDT 2025

Powered by FUDForum. Page generated in 0.04137 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top