Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [dsdp-dd-dev] Re: Some thoughts on DSF

> From: dsdp-dd-dev-bounces@xxxxxxxxxxx 
> [mailto:dsdp-dd-dev-bounces@xxxxxxxxxxx] On Behalf Of Mario Pierro
> Sent: Tuesday, October 28, 2008 4:59 AM
> 
> 6) As with handling formatted values: I wonder if the 
> separation between an expression's data and its format is 
> something related to how GDB must approach the problem. In 
> our case, that means fetching the same data from the backend 
> twice, once for type description and then for actual value 
> retrieval - since the type description must be expressed in 
> the Data, while the format is only known when the 
> FormattedValueContext is supplied.

I struggled with this separation also, at first.  But now, I find
it gives more flexibility by grouping the data is smaller chunks.

If your backend is able to fetch both the type description and the value
at the same time (and you wish to do this), I agree that the service
should not issue
the command twice.  This can be taken care of relatively easily
(if I understood your problem properly):

1- the CommandCache should be triggered when the same command is issued
the second time, and the command should not actually be sent to the
backend.
The trick here, is that you should use the same context in both
instances
of the command.  If your backend can fetch the value of the data using
an IExpressionDMContext only (and does not need the
FormattedValueDMContext),
then, on the call that uses FormattedValueDMContext, simply extract 
IExpressionDMContext (using DMContexts.getAncestorOfType()), which
should
be the same as for the first call, thus triggering the commandCache.

and/or

2- your service can store the value that was fetched by the first
command,
and use its result for the call using FormattedValueDMContext.  In the
GDB
reference app, the MIVariableManager class stores all the values of
variables
that are known, and takes care of keeping them current; therefore, it
often
does not need to go to the backend to fetch them, even when the
CommandCache
is not triggered.

I hope this helps.

Marc


Back to the top