Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-debug-dev] Events and CDI

Matthew,

Please, see my comments inline.

----- Original Message ----- From: "Matthew Ballance" <matt.ballance@xxxxxxxxx>
To: "CDT Debug developers list" <cdt-debug-dev@xxxxxxxxxxx>
Sent: Tuesday, October 25, 2005 10:07 PM
Subject: Re: [cdt-debug-dev] Events and CDI


Okay, I'm still looking at this. I'm trying to make sense out of the
various accessor methods related to variables and the way that the
GDB/MI integration fires update events...

Attached is a screenshot of what I'm seeing. As far as I can tell, I'm
implementing all required methods (stubbed out to keep things simple,
but implemented nonetheless). I have trace messages in the methods, so I
can see that the 'LocalVariable.getValue()' and  'IntValue.intValue()'
methods are being called. Yet, the GUI still displays 'pending'. If I
select different elements in the target view (toggle back and forth
between stack frames), I can sometimes get a value or two to display.

Here are my two major questions:

- Can I treat methods like StackFrame.createLocalVariable() as a factory
method (ie it returns a new object each time it's called)? I notice the
GDB/MI integration does not, but I'm not sure if this is required by CDI
or by the GDB/MI integration architecture.


There are no restrictions on the "createLocalVariable()" method. The gdb/mi integration tries to minimize the number of created var-objects.

- Are there any good rules of thumb for when to fire Changed events and
Destroyed events? It's a bit unclear to me, from the GDB/MI source, what
things should trigger variable update. In general, should I update
Variables? VariableDescriptors? Values?


The "variable descriptor" is supposed to be a lightweight representation of a variable (name, for instance) as oppose of "real variable". The idea behind this is that you can request the list of variables names, but you need to display the values and get notifications only for selected variables. It makes sense for gdb/mi where the creation of a "var-object" is costly. In your implementation, you can combine these two steps in one and create ICDIVariable objects when the "getLocalVariabledescriptors" method is called (ICDIVariable subclasses ICDIVariableDescriptor). Change events should be fired by ICDIVariable objects. Firing Destroyed event doesn't have an effect in the current implementation, but I would suggest to fire it when the variable has been destroyed.


Thanks in advance!

-Matthew



On 10/19/05, Mikhail Khodjaiants < mikhailk@xxxxxxx
<mailto:mikhailk@xxxxxxx> > wrote:

You don't need to fire a CreatedEvent for local variables. The rendering
of
the Variables view is asynchronous and messages you see are generated by
the
label decorators. All you have to do is to implement the "getValue"
method
of ICDIVariable.

----- Original Message -----
From: "Matthew Ballance" < matt.ballance@xxxxxxxxx
<mailto:matt.ballance@xxxxxxxxx> >
To: "cdt-debug-dev" <  <mailto:cdt-debug-dev@xxxxxxxxxxx>
cdt-debug-dev@xxxxxxxxxxx>
Sent: Wednesday, October 19, 2005 9:45 AM
Subject: [cdt-debug-dev] Events and CDI


Hi all,

   I'm working on a debugger that uses the win32 and MS-provided
symbol-access APIs to support debugging of Visual Studio-compiled
applications. I've run into a problem with supporting variables and
thought that a CDI developer or a developer of the CDI gdb-mi debugger

could give me some pointers...

   My first attempt at showing variables was to get method-local
variables and parameters working. ICDIStackFrame has a method
getLocalVariableDescriptors() that returns an array of variables
descriptors. I've implemented this method to return variable
descriptors
for the local parameters of the current stack frame. What I observe in
Eclipse is that sometimes the <var-name> = <value> item is displayed
in
the Variables view, sometimes "Pending ..." is displayed, and
sometimes
"..." is shown.

   I learned when implemented breakpoints that a CreatedEvent had to
be
posted for each new breakpoint in addition to returning the breakpoint

object from the set<Type>Breakpoint. I thought that perhaps I needed
to
do something similar for variables. I started by posting
CreatedEvent's
when createLocalVariable() was called, but saw no change in behavior.
I
also tried posting CreateEvent's from getLocalVariableDescriptors().
Again, no change in behavior.

   Any thoughts on what I may be doing wrong?

   Thanks in advance!

Thanks and Regards,
Matthew





_______________________________________________
cdt-debug-dev mailing list
cdt-debug-dev@xxxxxxxxxxx <mailto:cdt-debug-dev@xxxxxxxxxxx>
https://dev.eclipse.org/mailman/listinfo/cdt-debug-dev
<https://dev.eclipse.org/mailman/listinfo/cdt-debug-dev>







Back to the top