gdb: fix vfork with multiple threads
[deliverable/binutils-gdb.git] / gdb / csky-tdep.c
index cd7d8c5a0b116e48fa8a66f3ef181f35c3005f80..5940429e19213fab880ae723d558b637c8130837 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for the CSKY architecture, for GDB.
 
-   Copyright (C) 2010-2019 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    Contributed by C-SKY Microsystems and Mentor Graphics.
 
@@ -20,7 +20,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "common/gdb_assert.h"
+#include "gdbsupport/gdb_assert.h"
 #include "frame.h"
 #include "inferior.h"
 #include "symtab.h"
@@ -49,7 +49,7 @@
 #include "floatformat.h"
 #include "remote.h"
 #include "target-descriptions.h"
-#include "dwarf2-frame.h"
+#include "dwarf2/frame.h"
 #include "user-regs.h"
 #include "valprint.h"
 #include "csky-tdep.h"
@@ -59,7 +59,7 @@
 #include <vector>
 
 /* Control debugging information emitted in this file.  */
-static int csky_debug = 0;
+static bool csky_debug = false;
 
 static struct reggroup *cr_reggroup;
 static struct reggroup *fr_reggroup;
@@ -162,7 +162,7 @@ csky_write_pc (regcache *regcache, CORE_ADDR val)
 
 /* C-Sky ABI register names.  */
 
-static const char *csky_register_names[] =
+static const char * const csky_register_names[] =
 {
   /* General registers 0 - 31.  */
   "r0",  "r1",  "r2",  "r3",  "r4",  "r5",  "r6",  "r7",
@@ -266,8 +266,8 @@ csky_vector_type (struct gdbarch *gdbarch)
   append_composite_type_field (t, "u8",
                               init_vector_type (bt->builtin_int8, 16));
 
-  TYPE_VECTOR (t) = 1;
-  TYPE_NAME (t) = "builtin_type_vec128i";
+  t->set_is_vector (true);
+  t->set_name ("builtin_type_vec128i");
 
   return t;
 }
@@ -502,7 +502,7 @@ struct csky_unwind_cache
   int framereg;
 
   /* Saved register offsets.  */
-  struct trad_frame_saved_reg *saved_regs;
+  trad_frame_saved_reg *saved_regs;
 };
 
 /* Do prologue analysis, returning the PC of the first instruction
@@ -1459,17 +1459,17 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
        {
          if (register_offsets[rn] >= 0)
            {
-             this_cache->saved_regs[rn].addr
-               = this_cache->prev_sp - register_offsets[rn];
+             this_cache->saved_regs[rn].set_addr (this_cache->prev_sp
+                                                  - register_offsets[rn]);
              if (csky_debug)
                {
                  CORE_ADDR rn_value = read_memory_unsigned_integer (
-                   this_cache->saved_regs[rn].addr, 4, byte_order);
+                   this_cache->saved_regs[rn].addr (), 4, byte_order);
                  fprintf_unfiltered (gdb_stdlog, "Saved register %s "
                                      "stored at 0x%08lx, value=0x%08lx\n",
                                      csky_register_names[rn],
                                      (unsigned long)
-                                       this_cache->saved_regs[rn].addr,
+                                       this_cache->saved_regs[rn].addr (),
                                      (unsigned long) rn_value);
                }
            }
@@ -1871,7 +1871,7 @@ csky_frame_unwind_cache (struct frame_info *this_frame)
                            func_end, this_frame, cache, lr_type);
 
   /* gdbarch_sp_regnum contains the value and not the address.  */
-  trad_frame_set_value (cache->saved_regs, sp_regnum, cache->prev_sp);
+  cache->saved_regs[sp_regnum].set_value (cache->prev_sp);
   return cache;
 }
 
@@ -1916,6 +1916,7 @@ csky_frame_prev_register (struct frame_info *this_frame,
    unwinder.  */
 
 static const struct frame_unwind csky_unwind_cache = {
+  "cski prologue",
   NORMAL_FRAME,
   default_frame_unwind_stop_reason,
   csky_frame_this_id,
@@ -1998,7 +1999,8 @@ csky_stub_prev_register (struct frame_info *this_frame,
                                       prev_regnum);
 }
 
-struct frame_unwind csky_stub_unwind = {
+static frame_unwind csky_stub_unwind = {
+  "csky stub",
   NORMAL_FRAME,
   default_frame_unwind_stop_reason,
   csky_stub_this_id,
@@ -2240,8 +2242,9 @@ csky_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   return gdbarch;
 }
 
+void _initialize_csky_tdep ();
 void
-_initialize_csky_tdep (void)
+_initialize_csky_tdep ()
 {
 
   register_gdbarch_init (bfd_arch_csky, csky_gdbarch_init);
This page took 0.027807 seconds and 4 git commands to generate.