Add some more casts (1/2)
[deliverable/binutils-gdb.git] / gdb / m68klinux-tdep.c
index ae2da9abc89aaf56c603a96b3771048ff7baa45f..02579b10940022b6e80a503bafdf71e7e0ab69bc 100644 (file)
@@ -1,6 +1,6 @@
 /* Motorola m68k target-dependent support for GNU/Linux.
 
-   Copyright (C) 1996-2014 Free Software Foundation, Inc.
+   Copyright (C) 1996-2015 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -263,7 +263,7 @@ m68k_linux_sigtramp_frame_cache (struct frame_info *this_frame,
   int i;
 
   if (*this_cache)
-    return *this_cache;
+    return (struct trad_frame_cache *) *this_cache;
 
   cache = trad_frame_cache_zalloc (this_frame);
 
@@ -369,23 +369,16 @@ static const struct regset m68k_linux_fpregset =
     regcache_supply_regset, regcache_collect_regset
   };
 
-/* Return the appropriate register set for the core section identified
-   by SECT_NAME and SECT_SIZE.  */
+/* Iterate over core file register note sections.  */
 
-static const struct regset *
-m68k_linux_regset_from_core_section (struct gdbarch *gdbarch,
-                                    const char *sect_name,
-                                    size_t sect_size)
+static void
+m68k_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 >= M68K_LINUX_GREGS_SIZE)
-    return &m68k_linux_gregset;
-
-  if (strcmp (sect_name, ".reg2") == 0
-      && sect_size >= M68K_LINUX_FPREGS_SIZE)
-    return &m68k_linux_fpregset;
-
-  return NULL;
+  cb (".reg", M68K_LINUX_GREGS_SIZE, &m68k_linux_gregset, NULL, cb_data);
+  cb (".reg2", M68K_LINUX_FPREGS_SIZE, &m68k_linux_fpregset, NULL, cb_data);
 }
 
 static void
@@ -423,14 +416,12 @@ m68k_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
 
   /* Core file support. */
-  set_gdbarch_regset_from_core_section
-    (gdbarch, m68k_linux_regset_from_core_section);
+  set_gdbarch_iterate_over_regset_sections
+    (gdbarch, m68k_linux_iterate_over_regset_sections);
 
   /* Enable TLS support.  */
   set_gdbarch_fetch_tls_load_module_address (gdbarch,
                                              svr4_fetch_objfile_link_map);
-
-  set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
 }
 
 /* Provide a prototype to silence -Wmissing-prototypes.  */
This page took 0.026308 seconds and 4 git commands to generate.