gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gdb / rs6000-lynx178-tdep.c
index 37ac61719a65c9f2c8be1e10f7ac255cb7fb091c..7f1825dc4535e439579ff7f3734e8100a21e495c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -33,7 +33,8 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
                                struct value *function,
                                struct regcache *regcache, CORE_ADDR bp_addr,
                                int nargs, struct value **args, CORE_ADDR sp,
-                               int struct_return, CORE_ADDR struct_addr)
+                               function_call_return_method return_method,
+                               CORE_ADDR struct_addr)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
@@ -44,7 +45,6 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
   gdb_byte tmp_buffer[50];
   int f_argno = 0;             /* current floating point argno */
   int wordsize = gdbarch_tdep (gdbarch)->wordsize;
-  CORE_ADDR func_addr = find_function_addr (function, NULL);
 
   struct value *arg = 0;
   struct type *type;
@@ -64,7 +64,7 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
      (which will be passed in r3) is used for struct return address.
      In that case we should advance one word and start from r4
      register to copy parameters.  */
-  if (struct_return)
+  if (return_method == return_method_struct)
     {
       regcache_raw_write_unsigned (regcache, tdep->ppc_gp0_regnum + 3,
                                   struct_addr);
@@ -96,7 +96,7 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
       type = check_typedef (value_type (arg));
       len = TYPE_LENGTH (type);
 
-      if (TYPE_CODE (type) == TYPE_CODE_FLT)
+      if (type->code () == TYPE_CODE_FLT)
        {
 
          /* Floating point arguments are passed in fpr's, as well as gpr's.
@@ -112,7 +112,7 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
          gdb_assert (len <= 8);
 
          target_float_convert (value_contents (arg), type, reg_val, reg_type);
-         regcache_cooked_write (regcache, fp_regnum, reg_val);
+         regcache->cooked_write (fp_regnum, reg_val);
          ++f_argno;
        }
 
@@ -128,9 +128,7 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
                      ((char *) value_contents (arg)) + argbytes,
                      (len - argbytes) > reg_size
                        ? reg_size : len - argbytes);
-             regcache_cooked_write (regcache,
-                                   tdep->ppc_gp0_regnum + 3 + ii,
-                                   word);
+             regcache->cooked_write (tdep->ppc_gp0_regnum + 3 + ii, word);
              ++ii, argbytes += reg_size;
 
              if (ii >= 8)
@@ -146,7 +144,7 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
 
          memset (word, 0, reg_size);
          memcpy (word, value_contents (arg), len);
-         regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3 +ii, word);
+         regcache->cooked_write (tdep->ppc_gp0_regnum + 3 +ii, word);
        }
       ++argno;
     }
@@ -224,14 +222,13 @@ ran_out_of_registers_for_arguments:
 
          /* Float types should be passed in fpr's, as well as in the
              stack.  */
-         if (TYPE_CODE (type) == TYPE_CODE_FLT && f_argno < 13)
+         if (type->code () == TYPE_CODE_FLT && f_argno < 13)
            {
 
              gdb_assert (len <= 8);
 
-             regcache_cooked_write (regcache,
-                                    tdep->ppc_fp0_regnum + 1 + f_argno,
-                                    value_contents (arg));
+             regcache->cooked_write (tdep->ppc_fp0_regnum + 1 + f_argno,
+                                     value_contents (arg));
              ++f_argno;
            }
 
@@ -277,13 +274,13 @@ rs6000_lynx178_return_value (struct gdbarch *gdbarch, struct value *function,
 
   /* AltiVec extension: Functions that declare a vector data type as a
      return value place that return value in VR2.  */
-  if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY && TYPE_VECTOR (valtype)
+  if (valtype->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (valtype)
       && TYPE_LENGTH (valtype) == 16)
     {
       if (readbuf)
        regcache->cooked_read (tdep->ppc_vr0_regnum + 2, readbuf);
       if (writebuf)
-       regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, writebuf);
+       regcache->cooked_write (tdep->ppc_vr0_regnum + 2, writebuf);
 
       return RETURN_VALUE_REGISTER_CONVENTION;
     }
@@ -293,16 +290,16 @@ rs6000_lynx178_return_value (struct gdbarch *gdbarch, struct value *function,
      allocated buffer into which the callee is assumed to store its
      return value.  All explicit parameters are appropriately
      relabeled.  */
-  if (TYPE_CODE (valtype) == TYPE_CODE_STRUCT
-      || TYPE_CODE (valtype) == TYPE_CODE_UNION
-      || TYPE_CODE (valtype) == TYPE_CODE_ARRAY)
+  if (valtype->code () == TYPE_CODE_STRUCT
+      || valtype->code () == TYPE_CODE_UNION
+      || valtype->code () == TYPE_CODE_ARRAY)
     return RETURN_VALUE_STRUCT_CONVENTION;
 
   /* Scalar floating-point values are returned in FPR1 for float or
      double, and in FPR1:FPR2 for quadword precision.  Fortran
      complex*8 and complex*16 are returned in FPR1:FPR2, and
      complex*32 is returned in FPR1:FPR4.  */
-  if (TYPE_CODE (valtype) == TYPE_CODE_FLT
+  if (valtype->code () == TYPE_CODE_FLT
       && (TYPE_LENGTH (valtype) == 4 || TYPE_LENGTH (valtype) == 8))
     {
       struct type *regtype = register_type (gdbarch, tdep->ppc_fp0_regnum);
@@ -319,7 +316,7 @@ rs6000_lynx178_return_value (struct gdbarch *gdbarch, struct value *function,
       if (writebuf)
        {
          target_float_convert (writebuf, valtype, regval, regtype);
-         regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, regval);
+         regcache->cooked_write (tdep->ppc_fp0_regnum + 1, regval);
        }
 
       return RETURN_VALUE_REGISTER_CONVENTION;
@@ -358,7 +355,7 @@ rs6000_lynx178_return_value (struct gdbarch *gdbarch, struct value *function,
 
   if (TYPE_LENGTH (valtype) == 8)
     {
-      gdb_assert (TYPE_CODE (valtype) != TYPE_CODE_FLT);
+      gdb_assert (valtype->code () != TYPE_CODE_FLT);
       gdb_assert (tdep->wordsize == 4);
 
       if (readbuf)
@@ -371,9 +368,8 @@ rs6000_lynx178_return_value (struct gdbarch *gdbarch, struct value *function,
        }
       if (writebuf)
        {
-         regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3, writebuf);
-         regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4,
-                                writebuf + 4);
+         regcache->cooked_write (tdep->ppc_gp0_regnum + 3, writebuf);
+         regcache->cooked_write (tdep->ppc_gp0_regnum + 4, writebuf + 4);
        }
 
       return RETURN_VALUE_REGISTER_CONVENTION;
@@ -410,8 +406,9 @@ rs6000_lynx178_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
 }
 
+void _initialize_rs6000_lynx178_tdep ();
 void
-_initialize_rs6000_lynx178_tdep (void)
+_initialize_rs6000_lynx178_tdep ()
 {
   gdbarch_register_osabi_sniffer (bfd_arch_rs6000,
                                   bfd_target_xcoff_flavour,
This page took 0.027737 seconds and 4 git commands to generate.