Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] rs6000-tdep.c: Undelete altivec_register_p()
@ 2002-08-26 16:52 Kevin Buettner
  2002-08-26 16:54 ` Elena Zannoni
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Buettner @ 2002-08-26 16:52 UTC (permalink / raw)
  To: gdb-patches; +Cc: Elena Zannoni

I've just committed the patch below.  It fixes gdb/667.  Thanks to Adam
Fedor for reporting this problem.

I considered moving altivec_register_p() into ppc-linux-nat.c, but it
seems likely that this function will be useful in other files as other
native ports are made altivec aware.  Thus, it makes more sense to leave
it in rs6000-tdep.c.

	* rs6000-tdep.c (altivec_register_p): Restore function inadvertently
	deleted in 2002-08-20 commit.  This function is still used by
	ppc-linux-nat.c.

Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.80
diff -u -p -r1.80 rs6000-tdep.c
--- rs6000-tdep.c	25 Aug 2002 15:18:41 -0000	1.80
+++ rs6000-tdep.c	26 Aug 2002 23:16:25 -0000
@@ -123,6 +123,17 @@ static void frame_get_saved_regs (struct
 				  struct rs6000_framedata * fdatap);
 static CORE_ADDR frame_initial_stack_address (struct frame_info *);
 
+/* Is REGNO an AltiVec register?  Return 1 if so, 0 otherwise.  */
+int
+altivec_register_p (int regno)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+  if (tdep->ppc_vr0_regnum < 0 || tdep->ppc_vrsave_regnum < 0)
+    return 0;
+  else
+    return (regno >= tdep->ppc_vr0_regnum && regno <= tdep->ppc_vrsave_regnum);
+}
+
 /* Read a LEN-byte address from debugged memory address MEMADDR. */
 
 static CORE_ADDR


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] rs6000-tdep.c: Undelete altivec_register_p()
  2002-08-26 16:52 [PATCH] rs6000-tdep.c: Undelete altivec_register_p() Kevin Buettner
@ 2002-08-26 16:54 ` Elena Zannoni
  0 siblings, 0 replies; 2+ messages in thread
From: Elena Zannoni @ 2002-08-26 16:54 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches, Elena Zannoni

Kevin Buettner writes:
 > I've just committed the patch below.  It fixes gdb/667.  Thanks to Adam
 > Fedor for reporting this problem.
 > 
 > I considered moving altivec_register_p() into ppc-linux-nat.c, but it
 > seems likely that this function will be useful in other files as other
 > native ports are made altivec aware.  Thus, it makes more sense to leave
 > it in rs6000-tdep.c.

Ooopss, thanks. I have been a bit to enthusiastic about deleting code.

Elena

 > 
 > 	* rs6000-tdep.c (altivec_register_p): Restore function inadvertently
 > 	deleted in 2002-08-20 commit.  This function is still used by
 > 	ppc-linux-nat.c.
 > 
 > Index: rs6000-tdep.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
 > retrieving revision 1.80
 > diff -u -p -r1.80 rs6000-tdep.c
 > --- rs6000-tdep.c	25 Aug 2002 15:18:41 -0000	1.80
 > +++ rs6000-tdep.c	26 Aug 2002 23:16:25 -0000
 > @@ -123,6 +123,17 @@ static void frame_get_saved_regs (struct
 >  				  struct rs6000_framedata * fdatap);
 >  static CORE_ADDR frame_initial_stack_address (struct frame_info *);
 >  
 > +/* Is REGNO an AltiVec register?  Return 1 if so, 0 otherwise.  */
 > +int
 > +altivec_register_p (int regno)
 > +{
 > +  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
 > +  if (tdep->ppc_vr0_regnum < 0 || tdep->ppc_vrsave_regnum < 0)
 > +    return 0;
 > +  else
 > +    return (regno >= tdep->ppc_vr0_regnum && regno <= tdep->ppc_vrsave_regnum);
 > +}
 > +
 >  /* Read a LEN-byte address from debugged memory address MEMADDR. */
 >  
 >  static CORE_ADDR


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-08-26 23:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-26 16:52 [PATCH] rs6000-tdep.c: Undelete altivec_register_p() Kevin Buettner
2002-08-26 16:54 ` Elena Zannoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox