From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14842 invoked by alias); 14 Oct 2011 23:36:41 -0000 Received: (qmail 14738 invoked by uid 22791); 14 Oct 2011 23:36:40 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ww0-f43.google.com (HELO mail-ww0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 14 Oct 2011 23:36:20 +0000 Received: by wwf27 with SMTP id 27so3395951wwf.12 for ; Fri, 14 Oct 2011 16:36:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.134.37 with SMTP id r37mr3344011wei.74.1318635378920; Fri, 14 Oct 2011 16:36:18 -0700 (PDT) Received: by 10.216.167.144 with HTTP; Fri, 14 Oct 2011 16:36:18 -0700 (PDT) In-Reply-To: References: <36B29E9D-F2B3-446F-AF8A-97254A3AAEE2@comcast.net> Date: Fri, 14 Oct 2011 23:36:00 -0000 Message-ID: Subject: Re: Python: fetch value when building gdb.Value object From: Jim Blandy To: Tom Tromey Cc: Paul Koning , gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-10/txt/msg00430.txt.bz2 On Tue, Oct 4, 2011 at 8:44 AM, Tom Tromey wrote: > The reason is that eager fetching can be very expensive. =A0E.g., you may > construct an intermediate value that is a very large array, but intend > only to reference a few elements. =A0This 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.