From 17c126391482f614c03b8321ea9be529f437c361 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Wed, 22 Apr 2009 15:14:59 +0000 Subject: [PATCH] * arm-linux-nat.c (fetch_register, store_register): Use ARM_CPSR_GREGNUM instead of ARM_CPSR_REGNUM. * arm-linux-tdep.c (arm_linux_supply_gregset, arm_linux_collect_gregset): Likewise. * arm-linux-tdep.h (ARM_CPSR_GREGNUM): New. * arm-tdep.h (ARM_CPSR_REGNUM): Remove. --- gdb/ChangeLog | 9 +++++++++ gdb/arm-linux-nat.c | 8 ++++---- gdb/arm-linux-tdep.c | 4 ++-- gdb/arm-linux-tdep.h | 3 +++ gdb/arm-tdep.h | 1 - 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 02c5a60..3740c81 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2009-04-22 Kazu Hirata + + * arm-linux-nat.c (fetch_register, store_register): Use + ARM_CPSR_GREGNUM instead of ARM_CPSR_REGNUM. + * arm-linux-tdep.c (arm_linux_supply_gregset, + arm_linux_collect_gregset): Likewise. + * arm-linux-tdep.h (ARM_CPSR_GREGNUM): New. + * arm-tdep.h (ARM_CPSR_REGNUM): Remove. + 2009-04-22 Hui Zhu * stack.c (_initialize_stack): Set the default of diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c index 0922d8e..40bed3b 100644 --- a/gdb/arm-linux-nat.c +++ b/gdb/arm-linux-nat.c @@ -246,7 +246,7 @@ fetch_register (struct regcache *regcache, int regno) { if (arm_apcs_32) regcache_raw_supply (regcache, ARM_PS_REGNUM, - (char *) ®s[ARM_CPSR_REGNUM]); + (char *) ®s[ARM_CPSR_GREGNUM]); else regcache_raw_supply (regcache, ARM_PS_REGNUM, (char *) ®s[ARM_PC_REGNUM]); @@ -286,7 +286,7 @@ fetch_regs (struct regcache *regcache) if (arm_apcs_32) regcache_raw_supply (regcache, ARM_PS_REGNUM, - (char *) ®s[ARM_CPSR_REGNUM]); + (char *) ®s[ARM_CPSR_GREGNUM]); else regcache_raw_supply (regcache, ARM_PS_REGNUM, (char *) ®s[ARM_PC_REGNUM]); @@ -324,7 +324,7 @@ store_register (const struct regcache *regcache, int regno) regcache_raw_collect (regcache, regno, (char *) ®s[regno]); else if (arm_apcs_32 && regno == ARM_PS_REGNUM) regcache_raw_collect (regcache, regno, - (char *) ®s[ARM_CPSR_REGNUM]); + (char *) ®s[ARM_CPSR_GREGNUM]); else if (!arm_apcs_32 && regno == ARM_PS_REGNUM) regcache_raw_collect (regcache, ARM_PC_REGNUM, (char *) ®s[ARM_PC_REGNUM]); @@ -362,7 +362,7 @@ store_regs (const struct regcache *regcache) if (arm_apcs_32 && regcache_valid_p (regcache, ARM_PS_REGNUM)) regcache_raw_collect (regcache, ARM_PS_REGNUM, - (char *) ®s[ARM_CPSR_REGNUM]); + (char *) ®s[ARM_CPSR_GREGNUM]); ret = ptrace (PTRACE_SETREGS, tid, 0, ®s); diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index b63d9ae..88976b9 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -382,7 +382,7 @@ arm_linux_supply_gregset (const struct regset *regset, { if (arm_apcs_32) regcache_raw_supply (regcache, ARM_PS_REGNUM, - gregs + INT_REGISTER_SIZE * ARM_CPSR_REGNUM); + gregs + INT_REGISTER_SIZE * ARM_CPSR_GREGNUM); else regcache_raw_supply (regcache, ARM_PS_REGNUM, gregs + INT_REGISTER_SIZE * ARM_PC_REGNUM); @@ -416,7 +416,7 @@ arm_linux_collect_gregset (const struct regset *regset, { if (arm_apcs_32) regcache_raw_collect (regcache, ARM_PS_REGNUM, - gregs + INT_REGISTER_SIZE * ARM_CPSR_REGNUM); + gregs + INT_REGISTER_SIZE * ARM_CPSR_GREGNUM); else regcache_raw_collect (regcache, ARM_PS_REGNUM, gregs + INT_REGISTER_SIZE * ARM_PC_REGNUM); diff --git a/gdb/arm-linux-tdep.h b/gdb/arm-linux-tdep.h index 397bc4b..2c03938 100644 --- a/gdb/arm-linux-tdep.h +++ b/gdb/arm-linux-tdep.h @@ -24,6 +24,9 @@ struct regcache; + 2 * INT_REGISTER_SIZE \ + 8 + INT_REGISTER_SIZE) +/* The index to access CSPR in user_regs defined in GLIBC. */ +#define ARM_CPSR_GREGNUM 16 + /* Support for register format used by the NWFPE FPA emulator. Each register takes three words, where either the first one, two, or three hold a single, double, or extended precision value (depending diff --git a/gdb/arm-tdep.h b/gdb/arm-tdep.h index 1f4c38a..7c27f11 100644 --- a/gdb/arm-tdep.h +++ b/gdb/arm-tdep.h @@ -38,7 +38,6 @@ enum gdb_regnum { ARM_F7_REGNUM = 23, /* last floating point register */ ARM_FPS_REGNUM = 24, /* floating point status register */ ARM_PS_REGNUM = 25, /* Contains processor status */ - ARM_CPSR_REGNUM = ARM_PS_REGNUM, ARM_WR0_REGNUM, /* WMMX data registers. */ ARM_WR15_REGNUM = ARM_WR0_REGNUM + 15, ARM_WC0_REGNUM, /* WMMX control registers. */ -- 2.7.4