Re: Python: fetch value when building gdb.Value object

Jim Blandy
2011-10-14T23:36:41Z

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.