public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* accessing altivec registers on ppc64
@ 2005-08-10 21:44 Paul Gilliam
  0 siblings, 0 replies; only message in thread
From: Paul Gilliam @ 2005-08-10 21:44 UTC (permalink / raw)
  To: gdb

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 #=-

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-08-10 21:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-10 21:44 accessing altivec registers on ppc64 Paul Gilliam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).