*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / arch-utils.c
index 1f85b38d29474a9c8c348f5adb36a53e7780287c..99370089f2356ad7314fb90923f000a198a5bd51 100644 (file)
@@ -54,23 +54,25 @@ legacy_return_value (struct gdbarch *gdbarch, struct type *valtype,
   int struct_return = ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT
                        || TYPE_CODE (valtype) == TYPE_CODE_UNION
                        || TYPE_CODE (valtype) == TYPE_CODE_ARRAY)
-                      && DEPRECATED_USE_STRUCT_CONVENTION (0, valtype));
+                      && gdbarch_deprecated_use_struct_convention
+                           (current_gdbarch, 0, valtype));
 
   if (writebuf != NULL)
     {
       gdb_assert (!struct_return);
       /* NOTE: cagney/2004-06-13: See stack.c:return_command.  Old
-        architectures don't expect STORE_RETURN_VALUE to handle small
+        architectures don't expect store_return_value to handle small
         structures.  Should not be called with such types.  */
       gdb_assert (TYPE_CODE (valtype) != TYPE_CODE_STRUCT
                  && TYPE_CODE (valtype) != TYPE_CODE_UNION);
-      STORE_RETURN_VALUE (valtype, regcache, writebuf);
+      gdbarch_store_return_value (current_gdbarch, valtype, regcache, writebuf);
     }
 
   if (readbuf != NULL)
     {
       gdb_assert (!struct_return);
-      EXTRACT_RETURN_VALUE (valtype, regcache, readbuf);
+      gdbarch_extract_return_value (current_gdbarch,
+                                   valtype, regcache, readbuf);
     }
 
   if (struct_return)
@@ -83,20 +85,20 @@ int
 legacy_register_sim_regno (int regnum)
 {
   /* Only makes sense to supply raw registers.  */
-  gdb_assert (regnum >= 0 && regnum < NUM_REGS);
+  gdb_assert (regnum >= 0 && regnum < gdbarch_num_regs (current_gdbarch));
   /* NOTE: cagney/2002-05-13: The old code did it this way and it is
      suspected that some GDB/SIM combinations may rely on this
      behavour.  The default should be one2one_register_sim_regno
      (below).  */
-  if (REGISTER_NAME (regnum) != NULL
-      && REGISTER_NAME (regnum)[0] != '\0')
+  if (gdbarch_register_name (current_gdbarch, regnum) != NULL
+      && gdbarch_register_name (current_gdbarch, regnum)[0] != '\0')
     return regnum;
   else
     return LEGACY_SIM_REGNO_IGNORE;
 }
 
 CORE_ADDR
-generic_skip_trampoline_code (CORE_ADDR pc)
+generic_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
 {
   return 0;
 }
@@ -119,7 +121,7 @@ generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
   return 0;
 }
 
-/* Helper functions for INNER_THAN */
+/* Helper functions for gdbarch_inner_than */
 
 int
 core_addr_lessthan (CORE_ADDR lhs, CORE_ADDR rhs)
@@ -173,7 +175,7 @@ cannot_register_not (int regnum)
 }
 
 /* Legacy version of target_virtual_frame_pointer().  Assumes that
-   there is an DEPRECATED_FP_REGNUM and that it is the same, cooked or
+   there is an gdbarch_deprecated_fp_regnum and that it is the same, cooked or
    raw.  */
 
 void
@@ -186,10 +188,14 @@ legacy_virtual_frame_pointer (CORE_ADDR pc,
      register and an offset can determine this.  I think it should
      instead generate a byte code expression as that would work better
      with things like Dwarf2's CFI.  */
-  if (DEPRECATED_FP_REGNUM >= 0 && DEPRECATED_FP_REGNUM < NUM_REGS)
-    *frame_regnum = DEPRECATED_FP_REGNUM;
-  else if (SP_REGNUM >= 0 && SP_REGNUM < NUM_REGS)
-    *frame_regnum = SP_REGNUM;
+  if (gdbarch_deprecated_fp_regnum (current_gdbarch) >= 0
+      && gdbarch_deprecated_fp_regnum (current_gdbarch)
+          < gdbarch_num_regs (current_gdbarch))
+    *frame_regnum = gdbarch_deprecated_fp_regnum (current_gdbarch);
+  else if (gdbarch_sp_regnum (current_gdbarch) >= 0
+          && gdbarch_sp_regnum (current_gdbarch)
+               < gdbarch_num_regs (current_gdbarch))
+    *frame_regnum = gdbarch_sp_regnum (current_gdbarch);
   else
     /* Should this be an internal error?  I guess so, it is reflecting
        an architectural limitation in the current design.  */
@@ -245,7 +251,7 @@ enum bfd_endian
 selected_byte_order (void)
 {
   if (target_byte_order_user != BFD_ENDIAN_UNKNOWN)
-    return TARGET_BYTE_ORDER;
+    return gdbarch_byte_order (current_gdbarch);
   else
     return BFD_ENDIAN_UNKNOWN;
 }
@@ -257,14 +263,14 @@ show_endian (struct ui_file *file, int from_tty, struct cmd_list_element *c,
             const char *value)
 {
   if (target_byte_order_user == BFD_ENDIAN_UNKNOWN)
-    if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+    if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
       fprintf_unfiltered (file, _("The target endianness is set automatically "
                                  "(currently big endian)\n"));
     else
       fprintf_unfiltered (file, _("The target endianness is set automatically "
                           "(currently little endian)\n"));
   else
-    if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+    if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
       fprintf_unfiltered (file,
                          _("The target is assumed to be big endian\n"));
     else
@@ -403,7 +409,7 @@ show_architecture (struct ui_file *file, int from_tty,
                   struct cmd_list_element *c, const char *value)
 {
   const char *arch;
-  arch = TARGET_ARCHITECTURE->printable_name;
+  arch = gdbarch_bfd_arch_info (current_gdbarch)->printable_name;
   if (target_architecture_user == NULL)
     fprintf_filtered (file, _("\
 The target architecture is set automatically (currently %s)\n"), arch);
This page took 0.024398 seconds and 4 git commands to generate.