linux-nat: Exploit /proc/<pid>/mem for writing
[deliverable/binutils-gdb.git] / gdb / frv-linux-tdep.c
index d9628458520617c0fdfb0f2c0a433f183d7e0056..eb87f93058b0287e8f05c585d1b6aa1ff2bffb78 100644 (file)
@@ -1,7 +1,7 @@
 /* Target-dependent code for GNU/Linux running on the Fujitsu FR-V,
    for GDB.
 
-   Copyright (C) 2004-2014 Free Software Foundation, Inc.
+   Copyright (C) 2004-2017 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -261,7 +261,6 @@ frv_linux_sigtramp_frame_cache (struct frame_info *this_frame,
                                void **this_cache)
 {
   struct gdbarch *gdbarch = get_frame_arch (this_frame);
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   struct trad_frame_cache *cache;
   CORE_ADDR addr;
@@ -271,7 +270,7 @@ frv_linux_sigtramp_frame_cache (struct frame_info *this_frame,
   struct frame_id this_id;
 
   if (*this_cache)
-    return *this_cache;
+    return (struct trad_frame_cache *) *this_cache;
 
   cache = trad_frame_cache_zalloc (this_frame);
 
@@ -443,19 +442,16 @@ static const struct regset frv_linux_fpregset =
   regcache_supply_regset, regcache_collect_regset
 };
 
-static const struct regset *
-frv_linux_regset_from_core_section (struct gdbarch *gdbarch,
-                                   const char *sect_name, size_t sect_size)
+static void
+frv_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
+                                       iterate_over_regset_sections_cb *cb,
+                                       void *cb_data,
+                                       const struct regcache *regcache)
 {
-  if (strcmp (sect_name, ".reg") == 0 
-      && sect_size >= sizeof (frv_elf_gregset_t))
-    return &frv_linux_gregset;
-
-  if (strcmp (sect_name, ".reg2") == 0 
-      && sect_size >= sizeof (frv_elf_fpregset_t))
-    return &frv_linux_fpregset;
-
-  return NULL;
+  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);
 }
 
 \f
@@ -467,8 +463,8 @@ frv_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   /* Set the sigtramp frame sniffer.  */
   frame_unwind_append_unwinder (gdbarch, &frv_linux_sigtramp_frame_unwind); 
 
-  set_gdbarch_regset_from_core_section (gdbarch,
-                                        frv_linux_regset_from_core_section);
+  set_gdbarch_iterate_over_regset_sections
+    (gdbarch, frv_linux_iterate_over_regset_sections);
 }
 
 static enum gdb_osabi
This page took 0.026142 seconds and 4 git commands to generate.