Automatic date update in version.in
[deliverable/binutils-gdb.git] / gdb / frv-linux-tdep.c
index e6472014df6efdc6c670b75a881357b79c50adcf..1f382157ecf79f08c7c4c8f0de0e4a9ec732bf25 100644 (file)
@@ -1,7 +1,7 @@
 /* Target-dependent code for GNU/Linux running on the Fujitsu FR-V,
    for GDB.
 
-   Copyright (C) 2004-2016 Free Software Foundation, Inc.
+   Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -31,6 +31,7 @@
 #include "frame-unwind.h"
 #include "regset.h"
 #include "linux-tdep.h"
+#include "gdbarch.h"
 
 /* Define the size (in bytes) of an FR-V instruction.  */
 static const int frv_instr_size = 4;
@@ -168,7 +169,7 @@ frv_linux_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc,
 
 static LONGEST
 frv_linux_sigcontext_reg_addr (struct frame_info *this_frame, int regno,
-                               CORE_ADDR *sc_addr_cache_ptr)
+                              CORE_ADDR *sc_addr_cache_ptr)
 {
   struct gdbarch *gdbarch = get_frame_arch (this_frame);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
@@ -199,19 +200,19 @@ frv_linux_sigcontext_reg_addr (struct frame_info *this_frame, int regno,
       else if (tramp_type == RT_SIGTRAMP)
        {
          /* For a realtime sigtramp frame, SP + 12 contains a pointer
-            to a ucontext struct.  The ucontext struct contains a
-            sigcontext struct starting 24 bytes in.  (The offset of
-            uc_mcontext within struct ucontext is derived as follows: 
-            stack_t is a 12-byte struct and struct sigcontext is
-            8-byte aligned.  This gives an offset of 8 + 12 + 4 (for
-            padding) = 24.)  */
+            to a ucontext struct.  The ucontext struct contains a
+            sigcontext struct starting 24 bytes in.  (The offset of
+            uc_mcontext within struct ucontext is derived as follows: 
+            stack_t is a 12-byte struct and struct sigcontext is
+            8-byte aligned.  This gives an offset of 8 + 12 + 4 (for
+            padding) = 24.)  */
          if (target_read_memory (sp + 12, buf, sizeof buf) != 0)
            {
              warning (_("Can't read realtime sigtramp frame."));
              return 0;
            }
          sc_addr = extract_unsigned_integer (buf, sizeof buf, byte_order);
-         sc_addr += 24;
+         sc_addr += 24;
        }
       else
        internal_error (__FILE__, __LINE__, _("not a signal trampoline"));
@@ -333,6 +334,7 @@ frv_linux_sigtramp_frame_sniffer (const struct frame_unwind *self,
 
 static const struct frame_unwind frv_linux_sigtramp_frame_unwind =
 {
+  "frv linux sigtramp",
   SIGTRAMP_FRAME,
   default_frame_unwind_stop_reason,
   frv_linux_sigtramp_frame_this_id,
@@ -409,21 +411,18 @@ static const struct regcache_map_entry frv_linux_fpregmap[] =
 
 static void 
 frv_linux_supply_gregset (const struct regset *regset,
-                          struct regcache *regcache,
+                         struct regcache *regcache,
                          int regnum, const void *gregs, size_t len)
 {
   int regi;
-  char zerobuf[MAX_REGISTER_SIZE];
-
-  memset (zerobuf, 0, MAX_REGISTER_SIZE);
 
   /* gr0 always contains 0.  Also, the kernel passes the TBR value in
      this slot.  */
-  regcache_raw_supply (regcache, first_gpr_regnum, zerobuf);
+  regcache->raw_supply_zeroed (first_gpr_regnum);
 
   /* Fill gr32, ..., gr63 with zeros. */
   for (regi = first_gpr_regnum + 32; regi <= last_gpr_regnum; regi++)
-    regcache_raw_supply (regcache, regi, zerobuf);
+    regcache->raw_supply_zeroed (regi);
 
   regcache_supply_regset (regset, regcache, regnum, gregs, len);
 }
@@ -448,17 +447,17 @@ frv_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                        void *cb_data,
                                        const struct regcache *regcache)
 {
-  cb (".reg", sizeof (frv_elf_gregset_t), &frv_linux_gregset,
-      NULL, cb_data);
-  cb (".reg2", sizeof (frv_elf_fpregset_t), &frv_linux_fpregset,
-      NULL, cb_data);
+  cb (".reg", sizeof (frv_elf_gregset_t), sizeof (frv_elf_gregset_t),
+      &frv_linux_gregset, NULL, cb_data);
+  cb (".reg2", sizeof (frv_elf_fpregset_t), sizeof (frv_elf_fpregset_t),
+      &frv_linux_fpregset, NULL, cb_data);
 }
 
 \f
 static void
 frv_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
-  linux_init_abi (info, gdbarch);
+  linux_init_abi (info, gdbarch, 0);
 
   /* Set the sigtramp frame sniffer.  */
   frame_unwind_append_unwinder (gdbarch, &frv_linux_sigtramp_frame_unwind); 
@@ -483,11 +482,9 @@ frv_linux_elf_osabi_sniffer (bfd *abfd)
     return GDB_OSABI_UNKNOWN;
 }
 
-/* Provide a prototype to silence -Wmissing-prototypes.  */
-void _initialize_frv_linux_tdep (void);
-
+void _initialize_frv_linux_tdep ();
 void
-_initialize_frv_linux_tdep (void)
+_initialize_frv_linux_tdep ()
 {
   gdbarch_register_osabi (bfd_arch_frv, 0, GDB_OSABI_LINUX,
                          frv_linux_init_abi);
This page took 0.026773 seconds and 4 git commands to generate.