From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19691 invoked by alias); 10 Oct 2005 20:50:50 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 19684 invoked by uid 22791); 10 Oct 2005 20:50:49 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 10 Oct 2005 20:50:49 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1EP4be-0001Qj-Mz; Mon, 10 Oct 2005 16:50:46 -0400 Date: Mon, 10 Oct 2005 20:50:00 -0000 From: Daniel Jacobowitz To: David Lecomber Cc: gdb Subject: Re: Laziness Message-ID: <20051010205046.GA5362@nevyn.them.org> Mail-Followup-To: David Lecomber , gdb References: <1128978249.13892.22.camel@cpc2-oxfd8-3-0-cust199.oxfd.cable.ntl.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1128978249.13892.22.camel@cpc2-oxfd8-3-0-cust199.oxfd.cable.ntl.com> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-10/txt/msg00063.txt.bz2 On Mon, Oct 10, 2005 at 10:04:09PM +0100, David Lecomber wrote: > Hi Folks, > > Take a simple code with a big array... > > #include > int main() > { > double x[1000][1000]; > printf("hello mum"); > } > > and ask gdb to "set print elements 1", then break at the printf, and say > "output x". This is an inherent problem with the implementation of "set print elements". It prints only one _visible_ element, possibly with a marker. Search for that in valprint.c to see how this works. Perhaps we should redefine set print elements to only print anything pertaining to the original number of elements. > Should we really really be reading all that memory, just to print the > first element? I mean, not only is that slow, but it imposes a memory > overhead in the GDB too! Not really, for the latter complaint; we discard them as they're read in. -- Daniel Jacobowitz CodeSourcery, LLC