diff options
author | Markus Deuling <deuling@de.ibm.com> | 2007-11-07 06:36:57 +0000 |
---|---|---|
committer | Markus Deuling <deuling@de.ibm.com> | 2007-11-07 06:36:57 +0000 |
commit | 8fe9ea88f1c1a9466af1a78a3219b9e4d15a2e26 (patch) | |
tree | 78c1ed5dc7fda1319927739e5bcc6be97d321c8e | |
parent | 67d57894593345f23efe728f00b0a8c72216b962 (diff) | |
download | gdb-8fe9ea88f1c1a9466af1a78a3219b9e4d15a2e26.zip gdb-8fe9ea88f1c1a9466af1a78a3219b9e4d15a2e26.tar.gz gdb-8fe9ea88f1c1a9466af1a78a3219b9e4d15a2e26.tar.bz2 |
2007-11-07 Markus Deuling <deuling@de.ibm.com>
* s390-nat.c (supply_gregset, fill_gregset): Use get_regcache_arch to
get at the current architecture by regcache.
(SUBOFF): Add gdbarch to macro definition.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/s390-nat.c | 14 |
2 files changed, 15 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9450432..dc3d669 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2007-11-07 Markus Deuling <deuling@de.ibm.com> + * s390-nat.c (supply_gregset, fill_gregset): Use get_regcache_arch to + get at the current architecture by regcache. + (SUBOFF): Add gdbarch to macro definition. + +2007-11-07 Markus Deuling <deuling@de.ibm.com> + * gdbarch.sh (breakpoint_from_pc): Add gdbarch parameter. * gdbarch.{c,h}: Regenerate. diff --git a/gdb/s390-nat.c b/gdb/s390-nat.c index 6fe6939..3904c51 100644 --- a/gdb/s390-nat.c +++ b/gdb/s390-nat.c @@ -50,12 +50,12 @@ we have to fix up the 64-bit registers we get from the kernel to make them look like 32-bit registers. */ #ifdef __s390x__ -#define SUBOFF(i) \ - ((gdbarch_ptr_bit (current_gdbarch) == 32 \ +#define SUBOFF(gdbarch, i) \ + ((gdbarch_ptr_bit (gdbarch) == 32 \ && ((i) == S390_PSWA_REGNUM \ || ((i) >= S390_R0_REGNUM && (i) <= S390_R15_REGNUM)))? 4 : 0) #else -#define SUBOFF(i) 0 +#define SUBOFF(gdbarch, i) 0 #endif @@ -64,11 +64,13 @@ void supply_gregset (struct regcache *regcache, const gregset_t *regp) { + struct gdbarch *gdbarch = get_regcache_arch (regcache); int i; for (i = 0; i < S390_NUM_REGS; i++) if (regmap_gregset[i] != -1) regcache_raw_supply (regcache, i, - (const char *)regp + regmap_gregset[i] + SUBOFF (i)); + (const char *)regp + regmap_gregset[i] + + SUBOFF (gdbarch, i)); } /* Fill register REGNO (if it is a general-purpose register) in @@ -77,12 +79,14 @@ supply_gregset (struct regcache *regcache, const gregset_t *regp) void fill_gregset (const struct regcache *regcache, gregset_t *regp, int regno) { + struct gdbarch *gdbarch = get_regcache_arch (regcache); int i; for (i = 0; i < S390_NUM_REGS; i++) if (regmap_gregset[i] != -1) if (regno == -1 || regno == i) regcache_raw_collect (regcache, i, - (char *)regp + regmap_gregset[i] + SUBOFF (i)); + (char *)regp + regmap_gregset[i] + + SUBOFF (gdbarch, i)); } /* Fill GDB's register array with the floating-point register values |