Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Elena Zannoni <ezannoni@redhat.com>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: Elena Zannoni <ezannoni@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: [RFA] ppc-linux-nat.c AltiVec regs ptrace
Date: Wed, 20 Feb 2002 13:07:00 -0000	[thread overview]
Message-ID: <15476.4080.303671.894065@localhost.redhat.com> (raw)
In-Reply-To: <20020220153946.A24439@nevyn.them.org>

Daniel Jacobowitz writes:
 > On Wed, Feb 20, 2002 at 03:20:44PM -0500, Elena Zannoni wrote:
 > > This patch adds support for fetching and storing the AltiVec registers
 > > on PPC.  I previously submitted a different patch based on a different
 > > ptrace interface that was rejected by the ppc linux kernel maintainer.
 > > A new ptrace interface has since been added to the kernel:
 > > http://ppc.bkbits.net:8080/linuxppc_2_4/cset@1.543.1.14
 > > 
 > > This was the old patch, which is now obsolete:
 > > http://sources.redhat.com/ml/gdb-patches/2001-11/msg00548.html
 > 
 > Thanks for keeping at this after we made you run around in circles on
 > the ptrace interface.
 > 
 > > The Altivec registers are defined like this:
 > > #define ELF_NVRREG      33      /* includes vscr */
 > > /* Altivec registers */
 > > typedef __vector128 elf_vrreg_t;
 > > typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
 > > 
 > > There are 32 vector registers 16 bytes longs, plus a VSCR register
 > > which is only 4 bytes long, but is fetched as a 16 bytes quantity. Up
 > > to here we have the elf_vrregset_t structure.
 > > Appended to this there is space for the VRSAVE register: 4 bytes.
 > > Even though this vrsave register is not included in the regset
 > > typedef, it is handled by the ptrace requests.
 > > 
 > > The layout is like this:
 > > 
 > >  |.|.|.|.|.....|.|.|.|.||.|.|.|x||.|
 > >  <------->     <-------><-------><->
 > >    VR0           VR31     VSCR    VRSAVE
 > > (where x is the actual value of the vscr reg)
 > > 
 > > 
 > > I have added a typedef to the ppc-linux-nat.c file to deal with
 > > such a layout. I am not sure whether this is the best place to put
 > > that. Maybe in gregset.h?
 > 
 > Ew.  But I think it should remain local to ppc-linux-nat.c rather than
 > being visible anywhere outside the nat file.  Nothing else should need
 > to know.  Well, eventually the -tdep, since we will need this for
 > core files, but cross corefiles are not your problem at this point.

Yes, I don't like it much myself, that's why it's buried in here.

 > 
 > > Index: ppc-linux-nat.c
 > > ===================================================================
 > > RCS file: /cvs/uberbaum/gdb/ppc-linux-nat.c,v
 > > retrieving revision 1.15
 > > diff -u -p -r1.15 ppc-linux-nat.c
 > > --- ppc-linux-nat.c	2002/02/18 15:08:40	1.15
 > > +++ ppc-linux-nat.c	2002/02/20 19:27:29
 > > @@ -17,7 +17,7 @@
 > >     You should have received a copy of the GNU General Public License
 > >     along with this program; if not, write to the Free Software
 > >     Foundation, Inc., 59 Temple Place - Suite 330,
 > > -   Boston, MA 02111-1307, USA.  */
 > > +   Boston, MA 02111-1307, USA.*/
 > 
 > Nit.  Two spaces after periods.  You did this in a number of other
 > places throughout the patch, too.
 > 

Right will fix. [I had an ongoing bet :-)]

 > > +int have_ptrace_getvrregs
 > > +#ifdef HAVE_PTRACE_GETFPXREGS
 > > +     = 1;
 > > +#else
 > > +     = 0;
 > > +#endif
 > > +
 > 
 > Huh?  You defined GETVRREGS unconditionally above.  GETFPXREGS has no
 > place in this file, does it?  Or do the headers define GETFPXREGS?
 > You also continue this confusion all the way down the patch.
 > 

The glibc headers define GETFPXREGS, and that's what we test for in
the configury.  But we are not dealing with floating point registers
here, so I used the 'correct' name where I could.  It would be more
confusing to talk about FPX regs while instead there are none.
I explained this in the comments.

I guess I can do the following if it helps.
#ifdef HAVE_PTRACE_GETFPXREGS
#define HAVE_PTRACE_GETVRREGS

Whatever I end up using it's partially going to be a lie.  I would
prefer using the VRREGS nomenclature where relevant, though.



Elena

 > -- 
 > Daniel Jacobowitz                           Carnegie Mellon University
 > MontaVista Software                         Debian GNU/Linux Developer


  reply	other threads:[~2002-02-20 21:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-20 12:21 Elena Zannoni
2002-02-20 12:39 ` Daniel Jacobowitz
2002-02-20 13:07   ` Elena Zannoni [this message]
2002-02-20 14:15     ` Daniel Jacobowitz
2002-02-20 14:34       ` Andrew Cagney
2002-02-20 15:07       ` Elena Zannoni
2002-02-20 15:46         ` Daniel Jacobowitz
2002-02-20 16:28           ` Elena Zannoni
2002-02-20 16:34             ` Daniel Jacobowitz
2002-02-20 18:09               ` Elena Zannoni
2002-02-20 18:57                 ` Daniel Jacobowitz
2002-02-20 20:10                   ` Elena Zannoni
2002-02-20 21:04                 ` Kevin Buettner
2002-02-21  7:33                   ` Elena Zannoni
2002-02-21  7:33 ` Kevin Buettner
2002-02-21  7:39   ` Elena Zannoni
2002-02-21  8:00     ` Daniel Jacobowitz
2002-02-21 13:25   ` Elena Zannoni
2002-02-21 13:46     ` Kevin Buettner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15476.4080.303671.894065@localhost.redhat.com \
    --to=ezannoni@redhat.com \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox