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: Python: fetch value when building gdb.Value object


On Tue, Oct 4, 2011 at 8:44 AM, Tom Tromey <tromey@redhat.com> wrote:
> The reason is that eager fetching can be very expensive. ?E.g., you may
> construct an intermediate value that is a very large array, but intend
> only to reference a few elements. ?This can be done efficiently by gdb,
> but eager fetching will defeat that.

Yeah, this worried me, too. In C, array values are automatically
converted to pointers to their first element, but GDB doesn't (last I
checked) do this; instead, it relies on the lazy value fetching to get
the same effect. Unfortunately, this means that unlazying values can
have drastic effects on memory consumption that one would not expect
if one knows the C semantics.


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