Return std::string from ada_exception_catchpoint_cond_string
[deliverable/binutils-gdb.git] / gdb / sh-tdep.c
index 7d941e6235874a7a145be937f1fa6b01686f15a6..edf7e94b2ea58233ddadd37fb238b472c93bc1fd 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for Renesas Super-H, for GDB.
 
-   Copyright (C) 1993-2017 Free Software Foundation, Inc.
+   Copyright (C) 1993-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "inferior.h"
 #include "arch-utils.h"
 #include "regcache.h"
-#include "doublest.h"
+#include "target-float.h"
 #include "osabi.h"
 #include "reggroups.h"
 #include "regset.h"
 #include "objfiles.h"
 
 #include "sh-tdep.h"
-#include "sh64-tdep.h"
 
 #include "elf-bfd.h"
 #include "solib-svr4.h"
@@ -1310,7 +1309,7 @@ static void
 sh_extract_return_value_nofpu (struct type *type, struct regcache *regcache,
                               gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   int len = TYPE_LENGTH (type);
 
@@ -1335,7 +1334,7 @@ static void
 sh_extract_return_value_fpu (struct type *type, struct regcache *regcache,
                             gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   if (sh_treat_as_flt_p (type))
     {
       int len = TYPE_LENGTH (type);
@@ -1361,7 +1360,7 @@ static void
 sh_store_return_value_nofpu (struct type *type, struct regcache *regcache,
                             const gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   ULONGEST val;
   int len = TYPE_LENGTH (type);
@@ -1383,7 +1382,7 @@ static void
 sh_store_return_value_fpu (struct type *type, struct regcache *regcache,
                           const gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   if (sh_treat_as_flt_p (type))
     {
       int len = TYPE_LENGTH (type);
@@ -1576,8 +1575,8 @@ sh_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum,
     }
 
   if (regnum >= DR0_REGNUM && regnum <= DR_LAST_REGNUM)
-    convert_typed_floating (from, sh_littlebyte_bigword_type (gdbarch),
-                           to, type);
+    target_float_convert (from, sh_littlebyte_bigword_type (gdbarch),
+                         to, type);
   else
     error
       ("sh_register_convert_to_virtual called with non DR register number");
@@ -1595,8 +1594,8 @@ sh_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type,
     }
 
   if (regnum >= DR0_REGNUM && regnum <= DR_LAST_REGNUM)
-    convert_typed_floating (from, type,
-                           to, sh_littlebyte_bigword_type (gdbarch));
+    target_float_convert (from, type,
+                         to, sh_littlebyte_bigword_type (gdbarch));
   else
     error (_("sh_register_convert_to_raw called with non DR register number"));
 }
@@ -1628,7 +1627,7 @@ dr_reg_base_num (struct gdbarch *gdbarch, int dr_regnum)
 
 static enum register_status
 pseudo_register_read_portions (struct gdbarch *gdbarch,
-                              struct regcache *regcache,
+                              readable_regcache *regcache,
                               int portions,
                               int base_regnum, gdb_byte *buffer)
 {
@@ -1640,7 +1639,7 @@ pseudo_register_read_portions (struct gdbarch *gdbarch,
       gdb_byte *b;
 
       b = buffer + register_size (gdbarch, base_regnum) * portion;
-      status = regcache_raw_read (regcache, base_regnum + portion, b);
+      status = regcache->raw_read (base_regnum + portion, b);
       if (status != REG_VALID)
        return status;
     }
@@ -1649,14 +1648,14 @@ pseudo_register_read_portions (struct gdbarch *gdbarch,
 }
 
 static enum register_status
-sh_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
+sh_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache,
                         int reg_nr, gdb_byte *buffer)
 {
   int base_regnum;
   enum register_status status;
 
   if (reg_nr == PSEUDO_BANK_REGNUM)
-    return regcache_raw_read (regcache, BANK_REGNUM, buffer);
+    return regcache->raw_read (BANK_REGNUM, buffer);
   else if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM)
     {
       /* Enough space for two float registers.  */
@@ -2165,7 +2164,7 @@ sh_corefile_supply_regset (const struct regset *regset,
                           struct regcache *regcache,
                           int regnum, const void *regs, size_t len)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   const struct sh_corefile_regmap *regmap = (regset == &sh_corefile_gregset
                                             ? tdep->core_gregmap
@@ -2191,7 +2190,7 @@ sh_corefile_collect_regset (const struct regset *regset,
                            const struct regcache *regcache,
                            int regnum, void *regs, size_t len)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   const struct sh_corefile_regmap *regmap = (regset == &sh_corefile_gregset
                                             ? tdep->core_gregmap
@@ -2257,10 +2256,6 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   struct gdbarch *gdbarch;
   struct gdbarch_tdep *tdep;
 
-  /* SH5 is handled entirely in sh64-tdep.c.  */
-  if (info.bfd_arch_info->mach == bfd_mach_sh5)
-    return sh64_gdbarch_init (info, arches);
-
   /* If there is already a candidate, use it.  */
   arches = gdbarch_list_lookup_by_info (arches, &info);
   if (arches != NULL)
@@ -2436,13 +2431,13 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 }
 
 static void
-show_sh_command (char *args, int from_tty)
+show_sh_command (const char *args, int from_tty)
 {
   help_list (showshcmdlist, "show sh ", all_commands, gdb_stdout);
 }
 
 static void
-set_sh_command (char *args, int from_tty)
+set_sh_command (const char *args, int from_tty)
 {
   printf_unfiltered
     ("\"set sh\" must be followed by an appropriate subcommand.\n");
This page took 0.026442 seconds and 4 git commands to generate.