From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11062 invoked by alias); 9 Aug 2002 02:07:33 -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 11051 invoked from network); 9 Aug 2002 02:07:31 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 9 Aug 2002 02:07:31 -0000 Received: by localhost.redhat.com (Postfix, from userid 469) id B0DAB10D4D; Thu, 8 Aug 2002 22:05:45 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15699.9081.661920.38447@localhost.redhat.com> Date: Thu, 08 Aug 2002 19:07:00 -0000 To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: [patch/rfc] Don't include vector registers in ``info registers'' In-Reply-To: <3D5307C9.2010003@ges.redhat.com> References: <3D53041D.90609@ges.redhat.com> <3D5307C9.2010003@ges.redhat.com> X-SW-Source: 2002-08/txt/msg00204.txt.bz2 Ah, compare with what the rs6000-tdep.c has: rs6000_do_registers_info(). I made the same change, but also added a skipping of the print of a single vector register in decimal, it was taking up too much screen real estate. /* If not a vector register, print it also in decimal. */ if (!altivec_register_p (i)) { printf_filtered ("\t"); val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, gdb_stdout, 0, 1, 0, Val_pretty_default); } I also did something different: defining altivec_register_p(). I was envisioning this predicate becoming an architecture method called vector_register_p(). Another thing I've done in rs6000-tdep.c is the 'info vector' command (even though it is called 'info altivec'). I'll be submitting shortly another powerpc variation (the e500) which has vector registers, so I generalized things a bit in that file, wrt vector registers. Elena Andrew Cagney writes: > [With patch] > > > > Hello, > > > > The attached patch modifies the generic ``info registsters'' command so that it precludes vector registers (in addition to floating-point registers). The online doco indicates: > > > > (gdb) help info registers > > List of integer registers and their contents, for selected stack frame. > > Register name as argument means describe only that register. > > (gdb) help info all-registers > > List of all registers and their contents, for selected stack frame. > > Register name as argument means describe only that register. > > > > I think the change makes the behavour a better match for both the documentation and what I think is the intent of the command. Print a minimal set of registers. > > > > It will eventually affect the i386 -- I've a patch to change the type of xmm [and mmx] registers to true vectors. When that is in, ``info registers'' will stop displaying the xmm registers. > > > > Thoughts? > > > > enjoy, > > Andrew > > 2002-08-08 Andrew Cagney > > * infcmd.c (do_registers_info): Rename parameter ``fpregs'' to > ``print_all''. Only print vector registers when ``print_all''. > > Index: infcmd.c > =================================================================== > RCS file: /cvs/src/src/gdb/infcmd.c,v > retrieving revision 1.49 > diff -u -r1.49 infcmd.c > --- infcmd.c 3 Jul 2002 20:36:54 -0000 1.49 > +++ infcmd.c 8 Aug 2002 21:14:22 -0000 > @@ -1549,9 +1549,9 @@ > #ifdef REGISTER_NAMES > char *gdb_register_names[] = REGISTER_NAMES; > #endif > -/* Print out the machine register regnum. If regnum is -1, > - print all registers (fpregs == 1) or all non-float registers > - (fpregs == 0). > +/* Print out the machine register regnum. If regnum is -1, print all > + registers (all == 1) or all non-float and non-vector registers (all > + == 0). > > For most machines, having all_registers_info() print the > register(s) one per line is good enough. If a different format > @@ -1561,7 +1561,7 @@ > to provide that format. */ > > void > -do_registers_info (int regnum, int fpregs) > +do_registers_info (int regnum, int print_all) > { > register int i; > int numregs = NUM_REGS + NUM_PSEUDO_REGS; > @@ -1570,11 +1570,17 @@ > > for (i = 0; i < numregs; i++) > { > - /* Decide between printing all regs, nonfloat regs, or specific reg. */ > + /* Decide between printing all regs, non-float / vector regs, or > + specific reg. */ > if (regnum == -1) > { > - if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT && !fpregs) > - continue; > + if (!print_all) > + { > + if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT) > + continue; > + if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i))) > + continue; > + } > } > else > {