Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Elena Zannoni <ezannoni@cygnus.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: Elena Zannoni <ezannoni@cygnus.com>, gdb-patches@sources.redhat.com
Subject: Re: [RFA] W.I.P. AltiVec ppc registers support.
Date: Mon, 19 Nov 2001 18:51:00 -0000	[thread overview]
Message-ID: <15366.44991.616576.411278@krustylu.cygnus.com> (raw)
In-Reply-To: <1011129183830.ZM18856@ocotillo.lan>

Kevin Buettner writes:
 > On Nov 28,  9:15pm, Elena Zannoni wrote:
 > 
 > > The first Changelog is just for the most recent change set. I included
 > > the older one for easy reference.
 > 
 > Thanks for doing this.
 > 
 > > I tested this on AIX4.3, on a Linux-ppc with Altivec kernel support,
 > > and on a Linux-ppx w/o Altivec kernel support.
 > 
 > Good.
 > 
 > Now, for my comments...
 > 
 > First, regarding the AltiVec ptrace() support in the Linux/PPC
 > kernel...  Have the necessary patches been submitted to some public
 > mailing list?  If so, I'd be willing to let the ptrace related bits go
 > in even if they haven't been agreed upon by the kernel developers.  We
 > can always make adjustments to GDB later on after the kernel folks
 > have hashed out how they want to do things.  OTOH, I'm extremely
 > reluctant approve any changes to GDB based on kernel patches which
 > haven't at least been posted for commentary to some public list.

No :-( I am going hopefully to sort this out very soon.

 > 
 > Regarding the implementation...
 > 
 > > +/* AltiVec regs are not always supported by the kernel. We need to fake them,
 > > +   and let the ptrace requests fail.  */
 > > +#ifndef PT_VR0
 > > +#define PT_VR0 (PT_FPSCR + 1)
 > > +#endif
 > > +#ifndef PT_VR31
 > > +#define PT_VR31 (PT_VR0 + 4*31)
 > > +#endif
 > > +#ifndef PT_VRCR
 > > +#define PT_VRCR (PT_VR0 + 4*32)
 > > +#endif
 > > +#ifndef PT_VRSAVE
 > > +#define PT_VRSAVE (PT_VR0 + 4*33)
 > > +#endif
 > 
 > I don't think it's a good idea to provide fake PT_ constants,
 > especially since the kernel folks haven't agreed upon using PEEKUSER /
 > POKEUSER for accessing the AltiVec registers.  Also, in the interim,
 > it could happen that someone else will come up with a different ptrace
 > extension (perhaps involving hardware watchpoints?) that uses
 > constants at some of the offsets used by your fake AltiVec registers. 
 > If this were to happen, gdb could potentially write these registers
 > with unpredictable consequences.
 > 
 > The PT_V0 constant is the only constant used in the above defines and
 > it's only used in one place (in ppc_register_u_addr).  Rather than
 > using the above #defines, might I suggest that instead of doing:
 > 
 >   /* Altivec registers: 4 slots each. */
 >   if (altivec_register_p (regno))
 >     u_addr = (ustart + (PT_VR0 + (regno - gdbarch_tdep (current_gdbarch)->first_altivec_regnum) * 4) * 4);
 > 
 > you instead do:
 > 
 >   /* Altivec registers: 4 slots each. */
 >   if (altivec_register_p (regno))
 >     {
 > #ifdef PT_VR0
 >       u_addr = (ustart + (PT_VR0 + (regno - gdbarch_tdep (current_gdbarch)->first_altivec_regnum) * 4) * 4);
 > #else
 >       u_addr = -1;
 > #endif
 >     }
 > 
 > The #else clause isn't really necessary because you already initialize
 > u_addr to -1 at the outset.
 > 
 > The other advantage to doing things this way is that you'll no longer
 > need a separate fetch_altivec_register() function which differs from
 > fetch_register() only in that it doesn't print a message when ptrace()
 > produces an error.  (And likewise for store_register() /
 > store_altivec_register().)
 > 

Oh, right, I don't use anything but PT_VR0 now (I did in ohter
versions of the patch, and forgot to erase them).  It indeed seems
cleaner doing like you say. I also came up with a configure patch but
that seemed less flexible.

 > ....
 > 
 > Regarding...
 > 
 > > -static int regmap[] =
 > [etc]
 > 
 > from your previous patch, I've decided that while the code ends up being
 > more verbose, it is easier to read and understand what's going on.  So
 > I'm approving your previous patch.  (I'll send out a separate approval
 > message if you wish.)
 > 

Thanks, please, since that is a separate thread.

 > With regard to
 > 
 > > Index: config/powerpc/nm-linux.h
 > [...]
 > > +#define FETCH_INFERIOR_REGISTERS
 > 
 > I think this is a good thing.  It *might not* be strictly necessary
 > for adding AltiVec support via PEEKUSER / POKEUSER, but it does give
 > us more control.  Also doing this allows us to clean up the code in other
 > ways.  E.g, the following bit from config/powerpc/nm-linux.h can be
 > removed:
 > 
 > >  extern int ppc_register_u_addr (int, int);
 > >  #define REGISTER_U_ADDR(addr, blockend, regno) \
 > >          (addr) = ppc_register_u_addr ((blockend),(regno));
 > 
 > This in turn means that ppc_register_u_addr() can be made static
 > and that the ``ustart'' parameter can be removed.  All calls to
 > register_addr() (in your new code) in ppc-linux-nat.c should be
 > changed to invoke ppc_register_u_addr() directly.
 > 

Unfortunately not. I thought the same, until I remembered about core
file debugging. That function is called by fetch_core_registers() in
core-aout.c.


 > ....
 > 
 > Your changes to rs6000-tdep.c and ppc-tdep.h look fine to me.
 > 

OK.

 > Kevin

Elena


WARNING: multiple messages have this Message-ID
From: Elena Zannoni <ezannoni@cygnus.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: Elena Zannoni <ezannoni@cygnus.com>, gdb-patches@sources.redhat.com
Subject: Re: [RFA] W.I.P. AltiVec ppc registers support.
Date: Thu, 29 Nov 2001 13:53:00 -0000	[thread overview]
Message-ID: <15366.44991.616576.411278@krustylu.cygnus.com> (raw)
Message-ID: <20011129135300.hxOZWRfQkFcdbtKx94FJUC5jOIRmxdcxyRbuV0J9Kno@z> (raw)
In-Reply-To: <1011129183830.ZM18856@ocotillo.lan>

Kevin Buettner writes:
 > On Nov 28,  9:15pm, Elena Zannoni wrote:
 > 
 > > The first Changelog is just for the most recent change set. I included
 > > the older one for easy reference.
 > 
 > Thanks for doing this.
 > 
 > > I tested this on AIX4.3, on a Linux-ppc with Altivec kernel support,
 > > and on a Linux-ppx w/o Altivec kernel support.
 > 
 > Good.
 > 
 > Now, for my comments...
 > 
 > First, regarding the AltiVec ptrace() support in the Linux/PPC
 > kernel...  Have the necessary patches been submitted to some public
 > mailing list?  If so, I'd be willing to let the ptrace related bits go
 > in even if they haven't been agreed upon by the kernel developers.  We
 > can always make adjustments to GDB later on after the kernel folks
 > have hashed out how they want to do things.  OTOH, I'm extremely
 > reluctant approve any changes to GDB based on kernel patches which
 > haven't at least been posted for commentary to some public list.

No :-( I am going hopefully to sort this out very soon.

 > 
 > Regarding the implementation...
 > 
 > > +/* AltiVec regs are not always supported by the kernel. We need to fake them,
 > > +   and let the ptrace requests fail.  */
 > > +#ifndef PT_VR0
 > > +#define PT_VR0 (PT_FPSCR + 1)
 > > +#endif
 > > +#ifndef PT_VR31
 > > +#define PT_VR31 (PT_VR0 + 4*31)
 > > +#endif
 > > +#ifndef PT_VRCR
 > > +#define PT_VRCR (PT_VR0 + 4*32)
 > > +#endif
 > > +#ifndef PT_VRSAVE
 > > +#define PT_VRSAVE (PT_VR0 + 4*33)
 > > +#endif
 > 
 > I don't think it's a good idea to provide fake PT_ constants,
 > especially since the kernel folks haven't agreed upon using PEEKUSER /
 > POKEUSER for accessing the AltiVec registers.  Also, in the interim,
 > it could happen that someone else will come up with a different ptrace
 > extension (perhaps involving hardware watchpoints?) that uses
 > constants at some of the offsets used by your fake AltiVec registers. 
 > If this were to happen, gdb could potentially write these registers
 > with unpredictable consequences.
 > 
 > The PT_V0 constant is the only constant used in the above defines and
 > it's only used in one place (in ppc_register_u_addr).  Rather than
 > using the above #defines, might I suggest that instead of doing:
 > 
 >   /* Altivec registers: 4 slots each. */
 >   if (altivec_register_p (regno))
 >     u_addr = (ustart + (PT_VR0 + (regno - gdbarch_tdep (current_gdbarch)->first_altivec_regnum) * 4) * 4);
 > 
 > you instead do:
 > 
 >   /* Altivec registers: 4 slots each. */
 >   if (altivec_register_p (regno))
 >     {
 > #ifdef PT_VR0
 >       u_addr = (ustart + (PT_VR0 + (regno - gdbarch_tdep (current_gdbarch)->first_altivec_regnum) * 4) * 4);
 > #else
 >       u_addr = -1;
 > #endif
 >     }
 > 
 > The #else clause isn't really necessary because you already initialize
 > u_addr to -1 at the outset.
 > 
 > The other advantage to doing things this way is that you'll no longer
 > need a separate fetch_altivec_register() function which differs from
 > fetch_register() only in that it doesn't print a message when ptrace()
 > produces an error.  (And likewise for store_register() /
 > store_altivec_register().)
 > 

Oh, right, I don't use anything but PT_VR0 now (I did in ohter
versions of the patch, and forgot to erase them).  It indeed seems
cleaner doing like you say. I also came up with a configure patch but
that seemed less flexible.

 > ....
 > 
 > Regarding...
 > 
 > > -static int regmap[] =
 > [etc]
 > 
 > from your previous patch, I've decided that while the code ends up being
 > more verbose, it is easier to read and understand what's going on.  So
 > I'm approving your previous patch.  (I'll send out a separate approval
 > message if you wish.)
 > 

Thanks, please, since that is a separate thread.

 > With regard to
 > 
 > > Index: config/powerpc/nm-linux.h
 > [...]
 > > +#define FETCH_INFERIOR_REGISTERS
 > 
 > I think this is a good thing.  It *might not* be strictly necessary
 > for adding AltiVec support via PEEKUSER / POKEUSER, but it does give
 > us more control.  Also doing this allows us to clean up the code in other
 > ways.  E.g, the following bit from config/powerpc/nm-linux.h can be
 > removed:
 > 
 > >  extern int ppc_register_u_addr (int, int);
 > >  #define REGISTER_U_ADDR(addr, blockend, regno) \
 > >          (addr) = ppc_register_u_addr ((blockend),(regno));
 > 
 > This in turn means that ppc_register_u_addr() can be made static
 > and that the ``ustart'' parameter can be removed.  All calls to
 > register_addr() (in your new code) in ppc-linux-nat.c should be
 > changed to invoke ppc_register_u_addr() directly.
 > 

Unfortunately not. I thought the same, until I remembered about core
file debugging. That function is called by fetch_core_registers() in
core-aout.c.


 > ....
 > 
 > Your changes to rs6000-tdep.c and ppc-tdep.h look fine to me.
 > 

OK.

 > Kevin

Elena


  parent reply	other threads:[~2001-11-29 21:53 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-28 18:09 Elena Zannoni
2001-11-18 13:27 ` Elena Zannoni
2001-11-18 14:11 ` Daniel Jacobowitz
2001-11-19 12:59   ` Andrew Cagney
2001-11-29  9:04     ` Andrew Cagney
2001-11-29 13:10     ` Daniel Jacobowitz
2001-11-19 16:00       ` Daniel Jacobowitz
2001-11-29 13:34       ` Kevin Buettner
2001-11-19 16:42         ` Kevin Buettner
2001-11-29 14:11         ` Kevin Buettner
2001-11-19 22:22           ` Kevin Buettner
2001-11-29 14:27           ` Elena Zannoni
2001-11-19 23:55             ` Elena Zannoni
2001-11-28 22:27   ` Daniel Jacobowitz
2001-12-02 10:28   ` Elena Zannoni
2001-12-02 12:19     ` Andrew Cagney
2001-12-02 14:59     ` Daniel Jacobowitz
2001-12-02 22:25       ` Andrew Cagney
2001-11-28 18:33 ` Daniel Jacobowitz
2001-11-18 13:40   ` Daniel Jacobowitz
2001-11-29 10:40 ` Kevin Buettner
2001-11-19 15:15   ` Kevin Buettner
2001-11-19 18:51   ` Elena Zannoni [this message]
2001-11-29 13:53     ` Elena Zannoni
2001-11-29 14:21     ` Kevin Buettner
2001-11-19 22:53       ` Kevin Buettner
2001-11-29 14:42       ` Elena Zannoni
2001-11-20  8:37         ` Elena Zannoni
2001-11-29 15:03         ` Andrew Cagney
2001-11-20  8:54           ` Andrew Cagney
2001-11-29 16:27           ` Kevin Buettner
2001-11-20 16:00             ` Kevin Buettner
2001-11-20 16:14             ` Andrew Cagney
2001-11-21  3:33               ` Daniel Jacobowitz
2001-11-29 17:41                 ` Daniel Jacobowitz
2001-11-29 16:43               ` Andrew Cagney
2001-11-29 16:36             ` Elena Zannoni
2001-11-20 16:10               ` Elena Zannoni
2001-11-29 17:40               ` Daniel Jacobowitz
2001-11-20 18:00                 ` Daniel Jacobowitz
2001-11-29 14:47       ` Daniel Jacobowitz
2001-11-20  8:37         ` Daniel Jacobowitz
2001-11-20  9:07         ` Kevin Buettner
2001-11-20  9:08           ` Andrew Cagney
2001-11-29 15:33             ` Andrew Cagney
2001-11-29 15:15           ` Kevin Buettner
2001-11-29 15:38           ` Daniel Jacobowitz
2001-11-20  9:13             ` Daniel Jacobowitz
2001-11-20 10:09             ` Kevin Buettner
2001-11-29 15:47               ` Kevin Buettner
2001-11-29 15:58               ` Andrew Cagney
2001-11-20 10:59                 ` Andrew Cagney
2001-11-29 15:59               ` Daniel Jacobowitz
2001-11-20 11:07                 ` Daniel Jacobowitz
2001-11-29 16:17                 ` Andrew Cagney
2001-11-20 11:17                   ` Andrew Cagney
2001-11-20 17:52                   ` Daniel Jacobowitz
2001-11-29 17:39                     ` Daniel Jacobowitz
2001-11-29 18:20                     ` Andrew Cagney
2001-11-21  4:10                       ` Andrew Cagney
2001-11-29 22:36                       ` Daniel Jacobowitz
2001-11-21  5:56                         ` Daniel Jacobowitz
2001-12-20 10:02         ` Elena Zannoni

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=15366.44991.616576.411278@krustylu.cygnus.com \
    --to=ezannoni@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kevinb@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