This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Make static fields be lazy


Doug Evans wrote:
On Mon, Mar 22, 2010 at 12:00 PM, Stan Shebs <stan@codesourcery.com> wrote:
This is a small but interesting fix; C++ static fields were being gotten
using value_at instead of value_at_lazy.  So if you had a static field that
was a 5000-element array, then "print sfield[5]" would actually fetch all
5000 elements from the target, then just print the one.

[...]
fwiw, I think a comment is required in the code saying that
value_at_lazy is being used on purpose for the reasons you stated.
I think one shouldn't have to rely on the mailing list for
explanations of why code is the way it is (when it's easy to add such
explanations to the code).
That's a good point. By now just about all value_at's are lazy, this static field one was more of an unnoticed holdout, but it is not obvious that laziness is required by tracepoints, not just an optimization. I'll work up some commentary.

Stan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]