[
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
|
On 06/21/2010 12:16 PM, Mikhail Khodjaiants wrote:
It seems the following is a better option, but I haven't tried it yet.
public interface IGDBRegisters extends IRegisters {
public interface IGDBRegisterDMContext extends IRegisterDMContext {
IExpressionDMContext getExpressionDMC();
}
public interface IGDBRegisterDMData extends IRegisterDMData {
IExpressionDMData getExpressionData();
}
}
To me it seems that you'll have more flexibility if you keep the fact
that the registers use expressions underneath as an implementation
detail and not expose it in any API.
In this case I can pass IRegisterDMContext as a parent to
MIExpressionDMC.
I see, though I'm not entirely clear on why you need the register as a
parent context of the expression. The parent relationship in contexts
is mainly intended to allow you to implement equals() and hashCode() of
contexts properly. So for example, frame 0 of one thread is different
than frame 0 of another thread. In case of register service using the
expression service, a "#pc" expression created by the registers service
should be the same as a "#pc" expression typed in by the user in the
expressions view, and the same as "#pc" evaluated by some other client
(like the disassembly view). This will allow the expressions service to
user the same cach value of "#pc" for all the clients.
Cheers,
Pawel