Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-debug-dev] CValue.hasVariables()

Hm. Ok, so your experience hints that the backend may not have the data during some initial window of queries, but once it does have it, CDT can then cache that information. Since to the caller, "I have no children" and "Info not available, so no children" are indistinguishable I guess the only recourse is to keep calling the CDI client until a non-zero/empty value is returned, if that ever happens. This may seem trivial, but this inconsistency can produce more than subtle (perhaps negligible) performance irregularities. I got on this path because of a quirk in our debugger where after changing memory via the Memory view, one variable in the Variables view updated but the same did not happen for another. The reason turned out to be that we're hitting the backend in one case but not the other, and that is ultimately due to the cache inconsistencies I've brought up.

I'll go ahead and open bugzilla reports for this stuff. Thanks for the insight.

John

At 05:52 AM 11/22/2006, Mikhail Khodjaiants wrote:
John,

I think it's an oversight. It wouldn't make much difference for the
gdb/mi implementation, because the CDI values are also cached in the
backend.
Regarding your second question, I am not so sure. As I recall the first
implementation was based on the logic you described, but there have been
cases when it didn't work.
In my opinion the variables related code is too complicated because of
the many last minute changes. I wrote it, but now I think all caching
should have been done in the backend.

Mikhail

-----Original Message-----
From: cdt-debug-dev-bounces@xxxxxxxxxxx
[mailto:cdt-debug-dev-bounces@xxxxxxxxxxx] On Behalf Of John Cortell
Sent: 22 November 2006 04:18
To: CDT Debug developers list
Subject: [cdt-debug-dev] CValue.hasVariables()

I found that CValue fails to use its cached information in its
implementation of IValue.hasVariables(), resulting in a trip to the
backend on every invocation. If we use a cache to avoid repeated trips
to the backed for IValue.getValueString() and IValue.geVariables(), it
seems to me that not doing so for
hasVariables() is probably an oversight, and an opportunity for a
performance improvement (could help make a heavily populated variables
view a little snappier; this method gets called fairly often).

On the same token, the cache logic in getVariables0() seems a bit
flawed. Effectively, it says: if our cached children list is empty, then
we must have not gotten the list from the backend, so try to get it now.
But in fact, we might have been there before--already asked the backend
and it told us the variable has no children. So, really, we shouldn't be
asking again. Not sure how much we stand to gain here, but if we're
going to use a cache in CValue, we should probably use it in a
consistent manner.

I wanted to pose the question before opening a bugzilla report, in case
I'm overlooking something.

John

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

--
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


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



Back to the top