Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] DSF/GDB: context types required to create an expression

> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx 
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Mikhail Khodjaiants
> Sent: Monday, June 21, 2010 1:00 PM
> To: cdt-dev@xxxxxxxxxxx
> Subject: [cdt-dev] DSF/GDB: context types required to create 
> an expression
> Hi,
> There are three public constructors in MIExpressionDMC for various 
> context types. 

Those three types are the ones that seemed to be potential direct
parents of an expression.  For example, an expression representing
a local var would have a Frame as a parent, while a global variable
would have a MemoryContext as a parent.

> The underlying variable objects are created 
> against the 
> current context in GDB, so none of these particular context 
> types is used.

When we use MIVarCreate we use an Expression context, and although its
parent is not directly used in MIVarCreate, it is used in AbstractMIControl
to make sure the proper thread and frame are selected first.

> I am working on the variable object based implementation for 
> registers 
> and it meaningless to pass a thread or a frame context to create a 
> variable object for a register. It seems the parent register group 
> context is a natural candidate for this purpose. 

I guess the reg group makes sense to be proper.  However, I don't think
we need to know the group to be able to properly evaluate a register, right?
I mean, we don't need to tell GDB what group the register is part of.  What
we do need is to know which GDB to ask; this implies that we at least need
the parent to be an ICommandControlDMC.

>From an Eclipse/DSF point-of-view, it may be nice to have an expression
know which IRegisterDMC it represents, so you may even want to use
that as the parent (which has the reg group dmc and the ICommandControlDMC
in its hierarchy).

> Should I add a new 
> constructor or it is better to make the generic private 
> constructor public?

I would prefer to add a constructor with the parent you want to use.
I'm not a big fan of using IDMContext directly because it does not guide
a designer to know which context she should use.

I hope that doesn't cause too much headaches.


> Thanks,
> Mikhail
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx

Back to the top