* lib/gdb.exp (build_id_debug_filename_get): Improve check for
[deliverable/binutils-gdb.git] / gdb / arch-utils.c
index f0bc5bb1dab72014df5a5c076b1e3466f2f7dc6a..0a02d306f2faa892281caf2723a6bb11c97a6570 100644 (file)
@@ -7,7 +7,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -16,9 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 
@@ -54,23 +52,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)
@@ -96,7 +96,7 @@ legacy_register_sim_regno (int regnum)
 }
 
 CORE_ADDR
-generic_skip_trampoline_code (CORE_ADDR pc)
+generic_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
 {
   return 0;
 }
@@ -173,7 +173,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,11 +186,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 < gdbarch_num_regs (current_gdbarch))
-    *frame_regnum = DEPRECATED_FP_REGNUM;
-  else if (SP_REGNUM >= 0 && SP_REGNUM < gdbarch_num_regs (current_gdbarch))
-    *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.  */
@@ -404,7 +407,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.024265 seconds and 4 git commands to generate.