From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20856 invoked by alias); 15 Sep 2003 15:58:37 -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 20838 invoked from network); 15 Sep 2003 15:58:36 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 15 Sep 2003 15:58:36 -0000 Received: from drow by nevyn.them.org with local (Exim 4.22 #1 (Debian)) id 19yvkJ-00030p-ES; Mon, 15 Sep 2003 11:58:35 -0400 Date: Mon, 15 Sep 2003 15:58:00 -0000 From: Daniel Jacobowitz To: David Lecomber Cc: gdb-patches@sources.redhat.com Subject: Re: Large array printing patch for Fortran Message-ID: <20030915155834.GA8599@nevyn.them.org> Mail-Followup-To: David Lecomber , gdb-patches@sources.redhat.com References: <20030910143536.GA23943@streamline-computing.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030910143536.GA23943@streamline-computing.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-09/txt/msg00328.txt.bz2 On Wed, Sep 10, 2003 at 03:35:36PM +0100, David Lecomber wrote: > Resubmitting this (at last) - posted originally in May. > > The element printing limit for Fortran arrays is applied only for > the outer dimension of an array. Consequently, on entering a subroutine > with an argument of a (say) 1000x1000 array, the frame will take months > to print, which kind of ruins commands like 'bt', 'info args' etc.. David, [Assuming that this wasn't reviewed offlist - if so, whoever approved it, please don't do that.] Yes, I know that this patch hasn't been reviewed. That's a shame. Nag the list if you get impatient, but please stop checking things in to CVS! You're listed as a "Write After Approval" maintainer. If you can't wait for approval I'll ask to have you removed from that list. This was on my list to look at this week, when we were sure 6.0 was in the hole. > > > 2003-09-10 David Lecomber > > * f-valprint.c: Apply array element printing limits to > multi-dimensional arrays > > Index: f-valprint.c > =================================================================== > RCS file: /cvs/src/src/gdb/f-valprint.c,v > retrieving revision 1.15 > diff -u -p -r1.15 f-valprint.c > --- f-valprint.c 9 Sep 2003 23:09:37 -0000 1.15 > +++ f-valprint.c 10 Sep 2003 14:26:11 -0000 > @@ -47,7 +47,8 @@ static void f77_print_array (struct type > enum val_prettyprint); > static void f77_print_array_1 (int, int, struct type *, char *, > CORE_ADDR, struct ui_file *, int, int, int, > - enum val_prettyprint); > + enum val_prettyprint, > + int *elts); > static void f77_create_arrayprint_offset_tbl (struct type *, > struct ui_file *); > static void f77_get_dynamic_length_of_aggregate (struct type *); > @@ -271,31 +272,36 @@ f77_create_arrayprint_offset_tbl (struct > } > } > > + > + > /* Actual function which prints out F77 arrays, Valaddr == address in > the superior. Address == the address in the inferior. */ > - > static void > f77_print_array_1 (int nss, int ndimensions, struct type *type, char *valaddr, > CORE_ADDR address, struct ui_file *stream, int format, > - int deref_ref, int recurse, enum val_prettyprint pretty) > + int deref_ref, int recurse, enum val_prettyprint pretty, > + int *elts) > { > int i; > > if (nss != ndimensions) > { > - for (i = 0; i < F77_DIM_SIZE (nss); i++) > + for (i = 0; (i < F77_DIM_SIZE (nss) && (*elts) < print_max); i++) > { > fprintf_filtered (stream, "( "); > f77_print_array_1 (nss + 1, ndimensions, TYPE_TARGET_TYPE (type), > valaddr + i * F77_DIM_OFFSET (nss), > address + i * F77_DIM_OFFSET (nss), > - stream, format, deref_ref, recurse, pretty); > + stream, format, deref_ref, recurse, pretty, elts); > fprintf_filtered (stream, ") "); > } > + if (*elts >= print_max && i < F77_DIM_SIZE (nss)) { > + fprintf_filtered (stream, "..."); > + } > } > else > { > - for (i = 0; (i < F77_DIM_SIZE (nss) && i < print_max); i++) > + for (i = 0; (i < F77_DIM_SIZE (nss) && (*elts) < print_max); i++, (*elts)++) > { > val_print (TYPE_TARGET_TYPE (type), > valaddr + i * F77_DIM_OFFSET (ndimensions), > @@ -306,7 +312,7 @@ f77_print_array_1 (int nss, int ndimensi > if (i != (F77_DIM_SIZE (nss) - 1)) > fprintf_filtered (stream, ", "); > > - if (i == print_max - 1) > + if ((( *elts) == print_max - 1) && (i != (F77_DIM_SIZE (nss) - 1))) > fprintf_filtered (stream, "..."); > } > } > @@ -321,6 +327,7 @@ f77_print_array (struct type *type, char > enum val_prettyprint pretty) > { > int ndimensions; > + int elts = 0; > > ndimensions = calc_f77_array_dims (type); > > @@ -335,7 +342,7 @@ f77_print_array (struct type *type, char > f77_create_arrayprint_offset_tbl (type, stream); > > f77_print_array_1 (1, ndimensions, type, valaddr, address, stream, format, > - deref_ref, recurse, pretty); > + deref_ref, recurse, pretty, &elts); > } > > > -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer