* [PATCH] allow gdb to access altivec registers
@ 2005-10-17 20:31 Paul Gilliam
2005-10-17 21:05 ` Mark Kettenis
0 siblings, 1 reply; 8+ messages in thread
From: Paul Gilliam @ 2005-10-17 20:31 UTC (permalink / raw)
To: gdb-patches
In rs6000-tdep.c (rs6000_gdbarch_init), bfd_mach_ppc64 is assumed to NOT have
altivec registers.
This patch makes it assume that it does. This works for machines with the
IBM PowerPC 970 chip, an IBM JS-20 or Apple G5 for example.
If the bfd_mach_ppc64 should happen to NOT have an altivec unit, the ptrace
to get the vector registers will fail the first time it's called and it will
never be called again.
Here's the patch:
2005-10-17 Paul Gilliam <pgilliam@us.ibm.com>
* rs6000-tdep.c (rs6000_gdbarch_init): Assume that bfd_mach_ppc64 has
altivec unit, just like bfd_mach_ppc.
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.246
diff -a -u -p -r1.246 rs6000-tdep.c
--- rs6000-tdep.c 14 Oct 2005 20:17:11 -0000 1.246
+++ rs6000-tdep.c 17 Oct 2005 20:16:51 -0000
@@ -3240,6 +3240,7 @@ rs6000_gdbarch_init (struct gdbarch_info
switch (v->mach)
{
case bfd_mach_ppc:
+ case bfd_mach_ppc64:
tdep->ppc_sr0_regnum = -1;
tdep->ppc_vr0_regnum = 71;
tdep->ppc_vrsave_regnum = 104;
@@ -3263,7 +3264,6 @@ rs6000_gdbarch_init (struct gdbarch_info
set_gdbarch_register_reggroup_p (gdbarch, e500_register_reggroup_p);
break;
- case bfd_mach_ppc64:
case bfd_mach_ppc_620:
case bfd_mach_ppc_630:
case bfd_mach_ppc_a35:
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] allow gdb to access altivec registers
2005-10-17 20:31 [PATCH] allow gdb to access altivec registers Paul Gilliam
@ 2005-10-17 21:05 ` Mark Kettenis
2005-10-17 21:06 ` Daniel Jacobowitz
0 siblings, 1 reply; 8+ messages in thread
From: Mark Kettenis @ 2005-10-17 21:05 UTC (permalink / raw)
To: pgilliam; +Cc: gdb-patches
> From: Paul Gilliam <pgilliam@us.ibm.com>
> Date: Mon, 17 Oct 2005 13:32:13 -0700
>
> In rs6000-tdep.c (rs6000_gdbarch_init), bfd_mach_ppc64 is assumed to NOT have
> altivec registers.
>
> This patch makes it assume that it does. This works for machines with the
> IBM PowerPC 970 chip, an IBM JS-20 or Apple G5 for example.
>
> If the bfd_mach_ppc64 should happen to NOT have an altivec unit, the ptrace
> to get the vector registers will fail the first time it's called and it will
> never be called again.
You're assuming Linux here, but this is generic POWER/PowerPC code.
Unless there are no 64-bit POWER/PowerPC implementations without
AltiVec unit, this patch is wrong.
Mark
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] allow gdb to access altivec registers
2005-10-17 21:05 ` Mark Kettenis
@ 2005-10-17 21:06 ` Daniel Jacobowitz
2005-10-21 22:46 ` Paul Gilliam
0 siblings, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2005-10-17 21:06 UTC (permalink / raw)
To: Mark Kettenis; +Cc: pgilliam, gdb-patches
On Mon, Oct 17, 2005 at 11:05:11PM +0200, Mark Kettenis wrote:
> > From: Paul Gilliam <pgilliam@us.ibm.com>
> > Date: Mon, 17 Oct 2005 13:32:13 -0700
> >
> > In rs6000-tdep.c (rs6000_gdbarch_init), bfd_mach_ppc64 is assumed to NOT have
> > altivec registers.
> >
> > This patch makes it assume that it does. This works for machines with the
> > IBM PowerPC 970 chip, an IBM JS-20 or Apple G5 for example.
> >
> > If the bfd_mach_ppc64 should happen to NOT have an altivec unit, the ptrace
> > to get the vector registers will fail the first time it's called and it will
> > never be called again.
>
> You're assuming Linux here, but this is generic POWER/PowerPC code.
> Unless there are no 64-bit POWER/PowerPC implementations without
> AltiVec unit, this patch is wrong.
We should autodetect it, anyway. See my earlier proposal on this
subject.
I will be back to implementing that, hopefully, very soon.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] allow gdb to access altivec registers
2005-10-17 21:06 ` Daniel Jacobowitz
@ 2005-10-21 22:46 ` Paul Gilliam
2005-10-27 9:46 ` Kevin Buettner
0 siblings, 1 reply; 8+ messages in thread
From: Paul Gilliam @ 2005-10-21 22:46 UTC (permalink / raw)
To: gdb-patches
How 'bout this?
2005-10-17 Paul Gilliam <pgilliam@us.ibm.com>
* rs6000-tdep.c (rs6000_gdbarch_init): Assume that bfd_mach_ppc64 has
altivec unit, just like bfd_mach_ppc.
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.246
diff -a -u -p -r1.246 rs6000-tdep.c
--- rs6000-tdep.c 14 Oct 2005 20:17:11 -0000 1.246
+++ rs6000-tdep.c 21 Oct 2005 22:44:15 -0000
@@ -3376,10 +3376,21 @@ rs6000_gdbarch_init (struct gdbarch_info
switch (info.osabi)
{
+ case GDB_OSABI_LINUX:
+ /* FIXME: pgilliam/2005-10-21: Assume all PowerPC 64-bit linux systems
+ have altivec registers. If not, ptrace will fail the first time it's
+ called to access one and will not be called again. This wart will
+ be removed when Daniel Jacobowitz's proposal for autodetecting target
+ registers is implimented. */
+ if ((v->arch == bfd_arch_powerpc) and ((v->mach)== bfd_mach_ppc64))
+ {
+ tdep->ppc_vr0_regnum = 71;
+ tdep->ppc_vrsave_regnum = 104;
+ }
+ /* Fall Thru */
case GDB_OSABI_NETBSD_AOUT:
case GDB_OSABI_NETBSD_ELF:
case GDB_OSABI_UNKNOWN:
- case GDB_OSABI_LINUX:
set_gdbarch_unwind_pc (gdbarch, rs6000_unwind_pc);
frame_unwind_append_sniffer (gdbarch, rs6000_frame_sniffer);
set_gdbarch_unwind_dummy_id (gdbarch, rs6000_unwind_dummy_id);
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] allow gdb to access altivec registers
2005-10-21 22:46 ` Paul Gilliam
@ 2005-10-27 9:46 ` Kevin Buettner
2005-10-31 22:51 ` [PATCH] allow gdb to access altivec registers - OK to commit? Paul Gilliam
0 siblings, 1 reply; 8+ messages in thread
From: Kevin Buettner @ 2005-10-27 9:46 UTC (permalink / raw)
To: gdb-patches
On Fri, 21 Oct 2005 15:47:23 -0700
Paul Gilliam <pgilliam@us.ibm.com> wrote:
> How 'bout this?
>
> 2005-10-17 __Paul Gilliam __<pgilliam@us.ibm.com>
>
> * rs6000-tdep.c (rs6000_gdbarch_init): Assume that bfd_mach_ppc64 has
> altivec unit, just like bfd_mach_ppc.
This change is okay with me. But do revise the ChangeLog entry to note that
this change affects GNU/Linux only.
Kevin
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] allow gdb to access altivec registers - OK to commit?
2005-10-27 9:46 ` Kevin Buettner
@ 2005-10-31 22:51 ` Paul Gilliam
2005-11-01 0:27 ` Andreas Schwab
2005-11-02 20:44 ` Kevin Buettner
0 siblings, 2 replies; 8+ messages in thread
From: Paul Gilliam @ 2005-10-31 22:51 UTC (permalink / raw)
To: gdb-patches; +Cc: Kevin Buettner
I revised the ChangeLog entry to note that this change affects GNU/Linux only.
OK to commit? (was the previous posting by Kevin an OK to commit?)
-=# Paul #=-
PS: I realy want this to go int 6.4!
2005-10-31 Paul Gilliam <pgilliam@us.ibm.com>
* rs6000-tdep.c (rs6000_gdbarch_init): On GNU/Linux only, assume
that bfd_mach_ppc64 has altivec unit, just like bfd_mach_ppc.
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.246
diff -a -u -p -r1.246 rs6000-tdep.c
--- rs6000-tdep.c 14 Oct 2005 20:17:11 -0000 1.246
+++ rs6000-tdep.c 21 Oct 2005 22:44:15 -0000
@@ -3376,10 +3376,21 @@ rs6000_gdbarch_init (struct gdbarch_info
switch (info.osabi)
{
+ case GDB_OSABI_LINUX:
+ /* FIXME: pgilliam/2005-10-21: Assume all PowerPC 64-bit linux systems
+ have altivec registers. If not, ptrace will fail the first time it's
+ called to access one and will not be called again. This wart will
+ be removed when Daniel Jacobowitz's proposal for autodetecting target
+ registers is implimented. */
+ if ((v->arch == bfd_arch_powerpc) && ((v->mach)== bfd_mach_ppc64))
+ {
+ tdep->ppc_vr0_regnum = 71;
+ tdep->ppc_vrsave_regnum = 104;
+ }
+ /* Fall Thru */
case GDB_OSABI_NETBSD_AOUT:
case GDB_OSABI_NETBSD_ELF:
case GDB_OSABI_UNKNOWN:
- case GDB_OSABI_LINUX:
set_gdbarch_unwind_pc (gdbarch, rs6000_unwind_pc);
frame_unwind_append_sniffer (gdbarch, rs6000_frame_sniffer);
set_gdbarch_unwind_dummy_id (gdbarch, rs6000_unwind_dummy_id);
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] allow gdb to access altivec registers - OK to commit?
2005-10-31 22:51 ` [PATCH] allow gdb to access altivec registers - OK to commit? Paul Gilliam
@ 2005-11-01 0:27 ` Andreas Schwab
2005-11-02 20:44 ` Kevin Buettner
1 sibling, 0 replies; 8+ messages in thread
From: Andreas Schwab @ 2005-11-01 0:27 UTC (permalink / raw)
To: pgilliam; +Cc: gdb-patches, Kevin Buettner
Paul Gilliam <pgilliam@us.ibm.com> writes:
> + /* FIXME: pgilliam/2005-10-21: Assume all PowerPC 64-bit linux systems
> + have altivec registers. If not, ptrace will fail the first time it's
> + called to access one and will not be called again. This wart will
> + be removed when Daniel Jacobowitz's proposal for autodetecting target
> + registers is implimented. */
Typo: implemented.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] allow gdb to access altivec registers - OK to commit?
2005-10-31 22:51 ` [PATCH] allow gdb to access altivec registers - OK to commit? Paul Gilliam
2005-11-01 0:27 ` Andreas Schwab
@ 2005-11-02 20:44 ` Kevin Buettner
1 sibling, 0 replies; 8+ messages in thread
From: Kevin Buettner @ 2005-11-02 20:44 UTC (permalink / raw)
To: gdb-patches
On Mon, 31 Oct 2005 13:56:44 -0800
Paul Gilliam <pgilliam@us.ibm.com> wrote:
> OK to commit? (was the previous posting by Kevin an OK to commit?)
Yes, my previous posting was an okay to commit.
Kevin
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2005-11-02 20:34 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-17 20:31 [PATCH] allow gdb to access altivec registers Paul Gilliam
2005-10-17 21:05 ` Mark Kettenis
2005-10-17 21:06 ` Daniel Jacobowitz
2005-10-21 22:46 ` Paul Gilliam
2005-10-27 9:46 ` Kevin Buettner
2005-10-31 22:51 ` [PATCH] allow gdb to access altivec registers - OK to commit? Paul Gilliam
2005-11-01 0:27 ` Andreas Schwab
2005-11-02 20:44 ` Kevin Buettner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox