aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2003-06-13 00:03:03 +0000
committerJim Blandy <jimb@codesourcery.com>2003-06-13 00:03:03 +0000
commit49ff75ad913c5603e6a6378a8749cb3e67e440da (patch)
treee9186a7ec14f86fa6e04d6b3c2d3309b5c6d4175 /gdb
parente850da0b123eeea8b0274e7db5491136533605e4 (diff)
downloadfsf-binutils-gdb-49ff75ad913c5603e6a6378a8749cb3e67e440da.zip
fsf-binutils-gdb-49ff75ad913c5603e6a6378a8749cb3e67e440da.tar.gz
fsf-binutils-gdb-49ff75ad913c5603e6a6378a8749cb3e67e440da.tar.bz2
* ppc-linux-nat.c (ppc_register_u_addr): Correctly compute u-area
register offsets for both the 32- and 64-bit interfaces.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog3
-rw-r--r--gdb/ppc-linux-nat.c25
2 files changed, 17 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 81bd207..343b576 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,8 @@
2003-06-12 Jim Blandy <jimb@redhat.com>
+ * ppc-linux-nat.c (ppc_register_u_addr): Correctly compute u-area
+ register offsets for both the 32- and 64-bit interfaces.
+
Actually finish the job started by my change of 2003-05-29.
* config/powerpc/tm-linux.h (SKIP_TRAMPOLINE_CODE): Remove the
other #definition of this.
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index e164919..d0bff2e 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -127,34 +127,37 @@ ppc_register_u_addr (int regno)
{
int u_addr = -1;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ int wordsize = tdep->wordsize;
/* General purpose registers occupy 1 slot each in the buffer */
if (regno >= tdep->ppc_gp0_regnum && regno <= tdep->ppc_gplast_regnum )
- u_addr = ((PT_R0 + regno) * 4);
+ u_addr = ((PT_R0 + regno) * wordsize);
- /* Floating point regs: 2 slots each */
+ /* Floating point regs: eight bytes each in both 32- and 64-bit
+ ptrace interfaces. Thus, two slots each in 32-bit interface, one
+ slot each in 64-bit interface. */
if (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM)
- u_addr = ((PT_FPR0 + (regno - FP0_REGNUM) * 2) * 4);
+ u_addr = (PT_FPR0 * wordsize) + ((regno - FP0_REGNUM) * 8);
/* UISA special purpose registers: 1 slot each */
if (regno == PC_REGNUM)
- u_addr = PT_NIP * 4;
+ u_addr = PT_NIP * wordsize;
if (regno == tdep->ppc_lr_regnum)
- u_addr = PT_LNK * 4;
+ u_addr = PT_LNK * wordsize;
if (regno == tdep->ppc_cr_regnum)
- u_addr = PT_CCR * 4;
+ u_addr = PT_CCR * wordsize;
if (regno == tdep->ppc_xer_regnum)
- u_addr = PT_XER * 4;
+ u_addr = PT_XER * wordsize;
if (regno == tdep->ppc_ctr_regnum)
- u_addr = PT_CTR * 4;
+ u_addr = PT_CTR * wordsize;
#ifdef PT_MQ
if (regno == tdep->ppc_mq_regnum)
- u_addr = PT_MQ * 4;
+ u_addr = PT_MQ * wordsize;
#endif
if (regno == tdep->ppc_ps_regnum)
- u_addr = PT_MSR * 4;
+ u_addr = PT_MSR * wordsize;
if (regno == tdep->ppc_fpscr_regnum)
- u_addr = PT_FPSCR * 4;
+ u_addr = PT_FPSCR * wordsize;
return u_addr;
}