*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / s390-nat.c
index 6fe6939bcafbd998f11fa5083a510dcb94baaf4e..a6528e736461753770cf859a36b5b0a3bf738b2e 100644 (file)
    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
 
 
 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
@@ -200,7 +204,8 @@ store_fpregs (const struct regcache *regcache, int tid, int regnum)
 /* Fetch register REGNUM from the child process.  If REGNUM is -1, do
    this for all registers.  */
 static void
-s390_linux_fetch_inferior_registers (struct regcache *regcache, int regnum)
+s390_linux_fetch_inferior_registers (struct target_ops *ops,
+                                    struct regcache *regcache, int regnum)
 {
   int tid = s390_inferior_tid ();
 
@@ -216,7 +221,8 @@ s390_linux_fetch_inferior_registers (struct regcache *regcache, int regnum)
 /* Store register REGNUM back into the child process.  If REGNUM is
    -1, do this for all registers.  */
 static void
-s390_linux_store_inferior_registers (struct regcache *regcache, int regnum)
+s390_linux_store_inferior_registers (struct target_ops *ops,
+                                    struct regcache *regcache, int regnum)
 {
   int tid = s390_inferior_tid ();
 
This page took 0.024559 seconds and 4 git commands to generate.