Return gdbpy_ref from some Python string functions
[deliverable/binutils-gdb.git] / gdb / s390-tdep.c
index eaf15504d5cd9b38233e88d6d5633572249bf71b..23689aa71a151ef2629728246753bb66864ff914 100644 (file)
@@ -492,6 +492,9 @@ s390_displaced_step_fixup (struct gdbarch *gdbarch,
       /* Recompute saved return address in R1.  */
       regcache_cooked_write_unsigned (regs, S390_R0_REGNUM + r1,
                                      amode | (from + insnlen));
+      /* Update PC iff the instruction doesn't actually branch.  */
+      if (insn[0] == op_basr && r2 == 0)
+       regcache_write_pc (regs, from + insnlen);
     }
 
   /* Handle absolute branch instructions.  */
@@ -661,7 +664,7 @@ s390_load (struct s390_prologue_data *data,
   if (pv_is_constant (addr))
     {
       struct target_section *secp;
-      secp = target_section_by_addr (target_stack, addr.k);
+      secp = target_section_by_addr (current_top_target (), addr.k);
       if (secp != NULL
          && (bfd_get_section_flags (secp->the_bfd_section->owner,
                                     secp->the_bfd_section)
@@ -1074,10 +1077,10 @@ s390_guess_tracepoint_registers (struct gdbarch *gdbarch,
     }
 
   store_unsigned_integer (reg, sz, gdbarch_byte_order (gdbarch), pswa);
-  regcache_raw_supply (regcache, S390_PSWA_REGNUM, reg);
+  regcache->raw_supply (S390_PSWA_REGNUM, reg);
 
   store_unsigned_integer (reg, sz, gdbarch_byte_order (gdbarch), pswm);
-  regcache_raw_supply (regcache, S390_PSWM_REGNUM, reg);
+  regcache->raw_supply (S390_PSWM_REGNUM, reg);
 }
 
 /* Return the name of register REGNO.  Return the empty string for
@@ -1272,8 +1275,9 @@ s390_pseudo_register_type (struct gdbarch *gdbarch, int regnum)
   if (regnum_is_gpr_full (tdep, regnum))
     return builtin_type (gdbarch)->builtin_uint64;
 
+  /* For the "concatenated" vector registers use the same type as v16.  */
   if (regnum_is_vxr_full (tdep, regnum))
-    return tdesc_find_type (gdbarch, "vec128");
+    return tdesc_register_type (gdbarch, S390_V16_REGNUM);
 
   internal_error (__FILE__, __LINE__, _("invalid regnum"));
 }
@@ -1723,10 +1727,8 @@ s390_handle_arg (struct s390_arg_state *as, struct value *arg,
          /* When we store a single-precision value in an FP register,
             it occupies the leftmost bits.  */
          if (write_mode)
-           regcache_cooked_write_part (as->regcache,
-                                       S390_F0_REGNUM + as->fr,
-                                       0, length,
-                                       value_contents (arg));
+           as->regcache->cooked_write_part (S390_F0_REGNUM + as->fr, 0, length,
+                                            value_contents (arg));
          as->fr += 2;
        }
       else
@@ -1749,9 +1751,8 @@ s390_handle_arg (struct s390_arg_state *as, struct value *arg,
          int regnum = S390_V24_REGNUM + use_vr[as->vr] - 24;
 
          if (write_mode)
-           regcache_cooked_write_part (as->regcache, regnum,
-                                       0, length,
-                                       value_contents (arg));
+           as->regcache->cooked_write_part (regnum, 0, length,
+                                            value_contents (arg));
          as->vr++;
        }
       else
@@ -1980,28 +1981,24 @@ s390_register_return_value (struct gdbarch *gdbarch, struct type *type,
     {
       /* Float-like value: left-aligned in f0.  */
       if (in != NULL)
-       regcache_cooked_write_part (regcache, S390_F0_REGNUM,
-                                   0, length, in);
+       regcache->cooked_write_part (S390_F0_REGNUM, 0, length, in);
       else
-       regcache_cooked_read_part (regcache, S390_F0_REGNUM,
-                                  0, length, out);
+       regcache->cooked_read_part (S390_F0_REGNUM, 0, length, out);
     }
   else if (code == TYPE_CODE_ARRAY)
     {
       /* Vector: left-aligned in v24.  */
       if (in != NULL)
-       regcache_cooked_write_part (regcache, S390_V24_REGNUM,
-                                   0, length, in);
+       regcache->cooked_write_part (S390_V24_REGNUM, 0, length, in);
       else
-       regcache_cooked_read_part (regcache, S390_V24_REGNUM,
-                                  0, length, out);
+       regcache->cooked_read_part (S390_V24_REGNUM, 0, length, out);
     }
   else if (length <= word_size)
     {
       /* Integer: zero- or sign-extended in r2.  */
       if (out != NULL)
-       regcache_cooked_read_part (regcache, S390_R2_REGNUM,
-                                  word_size - length, length, out);
+       regcache->cooked_read_part (S390_R2_REGNUM, word_size - length, length,
+                                   out);
       else if (TYPE_UNSIGNED (type))
        regcache_cooked_write_unsigned
          (regcache, S390_R2_REGNUM,
@@ -2364,11 +2361,11 @@ s390_prologue_frame_unwind_cache (struct frame_info *this_frame,
             Recognize this case by looking ahead a bit ...  */
 
          struct s390_prologue_data data2;
-         pv_t *sp = &data2.gpr[S390_SP_REGNUM - S390_R0_REGNUM];
+         pv_t *sp2 = &data2.gpr[S390_SP_REGNUM - S390_R0_REGNUM];
 
          if (!(s390_analyze_prologue (gdbarch, func, (CORE_ADDR)-1, &data2)
-               && pv_is_register (*sp, S390_SP_REGNUM)
-               && sp->k != 0))
+               && pv_is_register (*sp2, S390_SP_REGNUM)
+               && sp2->k != 0))
            return 0;
        }
     }
This page took 0.026456 seconds and 4 git commands to generate.