summaryrefslogtreecommitdiffstats
path: root/gdb/aix-thread.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2004-05-07 20:50:37 +0000
committerJim Blandy <jimb@codesourcery.com>2004-05-07 20:50:37 +0000
commitdaf6dc85b1c6c4aa44dbd96210c5972cb31eabdf (patch)
treee2b7fad31e700dc38f2a9c574840fbad76a2dc97 /gdb/aix-thread.c
parent16796152f1c49bb26a9a1337008062b7a5e8bbba (diff)
downloadppe42-binutils-daf6dc85b1c6c4aa44dbd96210c5972cb31eabdf.tar.gz
ppe42-binutils-daf6dc85b1c6c4aa44dbd96210c5972cb31eabdf.zip
* aix-thread.c (fetch_regs_kernel_thread, fill_gprs64,
fill_gprs32, store_regs_kernel_thread): Use tdep->ppc_gp0_regnum to recognize gpr regnums, instead of assuming that tdep->ppc_fp0_regnum marks the end of the general-purpose registers.
Diffstat (limited to 'gdb/aix-thread.c')
-rw-r--r--gdb/aix-thread.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 36174b4499..2f79071346 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -1157,7 +1157,9 @@ fetch_regs_kernel_thread (int regno, pthdb_tid_t tid)
(long) tid, regno, arch64);
/* General-purpose registers. */
- if (regno == -1 || regno < tdep->ppc_fp0_regnum)
+ if (regno == -1
+ || (tdep->ppc_gp0_regnum <= regno
+ && regno < tdep->ppc_gp0_regnum + ppc_num_gprs))
{
if (arch64)
{
@@ -1246,9 +1248,9 @@ fill_gprs64 (uint64_t *vals)
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
int regno;
- for (regno = 0; regno < tdep->ppc_fp0_regnum; regno++)
- if (register_cached (regno))
- regcache_collect (regno, vals + regno);
+ for (regno = 0; regno < ppc_num_gprs; regno++)
+ if (register_cached (tdep->ppc_gp0_regnum + regno))
+ regcache_collect (tdep->ppc_gp0_regnum + regno, vals + regno);
}
static void
@@ -1257,9 +1259,9 @@ fill_gprs32 (uint32_t *vals)
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
int regno;
- for (regno = 0; regno < tdep->ppc_fp0_regnum; regno++)
- if (register_cached (regno))
- regcache_collect (regno, vals + regno);
+ for (regno = 0; regno < ppc_num_gprs; regno++)
+ if (register_cached (tdep->ppc_gp0_regnum + regno))
+ regcache_collect (tdep->ppc_gp0_regnum + regno, vals + regno);
}
/* Store the floating point registers into a double array. */
@@ -1456,7 +1458,9 @@ store_regs_kernel_thread (int regno, pthdb_tid_t tid)
(long) tid, regno);
/* General-purpose registers. */
- if (regno == -1 || regno < tdep->ppc_fp0_regnum)
+ if (regno == -1
+ || (tdep->ppc_gp0_regnum <= regno
+ && regno < tdep->ppc_gp0_regnum + ppc_num_fprs))
{
if (arch64)
{
OpenPOWER on IntegriCloud