From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5523 invoked by alias); 6 Sep 2005 20:57:25 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 5450 invoked by uid 22791); 6 Sep 2005 20:57:13 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 06 Sep 2005 20:57:13 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1ECkVC-0003QL-IK; Tue, 06 Sep 2005 16:57:10 -0400 Date: Tue, 06 Sep 2005 20:57:00 -0000 From: Daniel Jacobowitz To: Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC/RFA] print arrays with indexes Message-ID: <20050906205710.GA12715@nevyn.them.org> Mail-Followup-To: Joel Brobecker , gdb-patches@sources.redhat.com References: <20050906202018.GC1153@adacore.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050906202018.GC1153@adacore.com> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-09/txt/msg00034.txt.bz2 On Tue, Sep 06, 2005 at 01:20:18PM -0700, Joel Brobecker wrote: > So, the idea would be for GDB to print the above array as: > > (gdb) p array > $2 = {0 => 1, 1 => 2, 2 => 3, 3 => 4} > For the moment, the patch I am submitting here is using the Ada notation, > because C/C++/ObjC don't provide this way of "qualifying" each element. > Not sure about Fortran or Pascal. We can certainly make this a language > method, with a default method. In fact, C99 allows: int A[3] = { [1] = 2 }; GNU C has supported it for a while, I think. I don't think it works for C++. So, yes, a language method would be good. > (gdb) set/show print array-indexes > > With a default of "off", to preserve the current behavior. I suppose we've got to :-) I'd turn it on, that's for sure. Afraid I haven't time to look at the patch just now. I'll be back. -- Daniel Jacobowitz CodeSourcery, LLC