summaryrefslogtreecommitdiff
path: root/gdb/ppc-linux-nat.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2004-04-22 08:37:06 +0000
committerJim Blandy <jimb@codesourcery.com>2004-04-22 08:37:06 +0000
commite5e1fa1fe6e374837ff6263bd98cc4837908dd05 (patch)
tree17ee7c3c092bf030970f0ce11bc35409bc77b7cf /gdb/ppc-linux-nat.c
parent3c289a94afe05db5fec0e7072a3feee0b7dbab4e (diff)
downloadgdb-e5e1fa1fe6e374837ff6263bd98cc4837908dd05.tar.gz
* ppc-linux-nat.c (ppc_register_u_addr): Don't assume that r0 is
register number zero.
Diffstat (limited to 'gdb/ppc-linux-nat.c')
-rw-r--r--gdb/ppc-linux-nat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index a8eb7b6e002..b869ad0b2a2 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -133,7 +133,7 @@ ppc_register_u_addr (int regno)
/* 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) * wordsize);
+ u_addr = ((regno - tdep->ppc_gp0_regnum + PT_R0) * wordsize);
/* Floating point regs: eight bytes each in both 32- and 64-bit
ptrace interfaces. Thus, two slots each in 32-bit interface, one