This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
accessing altivec registers on ppc64
- From: Paul Gilliam <pgilliam at us dot ibm dot com>
- To: gdb at sources dot redhat dot com
- Date: Wed, 10 Aug 2005 15:12:38 -0700
- Subject: accessing altivec registers on ppc64
- Reply-to: pgilliam at us dot ibm dot com
On a GNU/linux system with kernel version 2.6.5-7.97-pmac64, I can't access the value in an altivec register.
This is using close to the latest CVS head version of GDB as a native debugger on an apple G5 running SuSE SLES 9.
In digging through the sources, I found the following in the function fetch_ppc_registers at line 487 of ppc-linux-nat.c:
if (have_ptrace_getvrregs)
if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1)
fetch_altivec_registers (tid);
have_ptrace_getvrregs is initialized to 1 and set to 0 only if a ptrace using PTRACE_GETVRREGS fails.
tdep->ppc_vr0_regnum and ppc_vrsave_regnum are set in rs6000_gdbarch_init(), in a switch statement at line 3217 of file rs6000-tdep.c,
depending on the value of v->mach. I my case, that value is 64 == bfd_mach_ppc64 so they are set to -1 and altivec registers are not fetched.
But if I seperate out that case and make it assign values as the bfd_mach_ppc case does, fetch_altivec_registers is still not called.
Does anyone know what's going on?
On a related topic:
When I do 'info vector', I get the first 31 general-purpose registers (r0 thru r30, but no r31) followed by the vector registers.
Any idea why the first 31 GP regs are inlcuded?
-=# Paul Gilliam #=-