Make gdb.mi/user-selected-context-sync.exp use proc_with_prefix
[deliverable/binutils-gdb.git] / gdb / ppcnbsd-tdep.c
index a5c1e3df1e930c0e5b612bb96ddf0a9d05781179..be152e1e795a6a11078127ac2a01b09b688420d8 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for NetBSD/powerpc.
 
-   Copyright (C) 2002-2014 Free Software Foundation, Inc.
+   Copyright (C) 2002-2016 Free Software Foundation, Inc.
 
    Contributed by Wasabi Systems, Inc.
 
@@ -51,20 +51,16 @@ const struct regset ppcnbsd_fpregset =
   ppc_supply_fpregset
 };
 
-/* 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 *
-ppcnbsd_regset_from_core_section (struct gdbarch *gdbarch,
-                                 const char *sect_name, size_t sect_size)
+static void
+ppcnbsd_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 >= 148)
-    return &ppcnbsd_gregset;
-
-  if (strcmp (sect_name, ".reg2") == 0 && sect_size >= 264)
-    return &ppcnbsd_fpregset;
-
-  return NULL;
+  cb (".reg", 148, &ppcnbsd_gregset, NULL, cb_data);
+  cb (".reg2", 264, &ppcnbsd_fpregset, NULL, cb_data);
 }
 \f
 
@@ -96,7 +92,7 @@ ppcnbsd_return_value (struct gdbarch *gdbarch, struct value *function,
 
 /* Signal trampolines.  */
 
-static const struct tramp_frame ppcnbsd2_sigtramp;
+extern const struct tramp_frame ppcnbsd2_sigtramp;
 
 static void
 ppcnbsd_sigtramp_cache_init (const struct tramp_frame *self,
@@ -155,7 +151,7 @@ static const struct tramp_frame ppcnbsd_sigtramp =
 
 /* NetBSD 2.0 introduced a slightly different signal trampoline.  */
 
-static const struct tramp_frame ppcnbsd2_sigtramp =
+const struct tramp_frame ppcnbsd2_sigtramp =
 {
   SIGTRAMP_FRAME,
   4,
@@ -185,8 +181,8 @@ ppcnbsd_init_abi (struct gdbarch_info info,
   set_solib_svr4_fetch_link_map_offsets
     (gdbarch, svr4_ilp32_fetch_link_map_offsets);
 
-  set_gdbarch_regset_from_core_section
-    (gdbarch, ppcnbsd_regset_from_core_section);
+  set_gdbarch_iterate_over_regset_sections
+    (gdbarch, ppcnbsd_iterate_over_regset_sections);
 
   tramp_frame_prepend_unwinder (gdbarch, &ppcnbsd_sigtramp);
   tramp_frame_prepend_unwinder (gdbarch, &ppcnbsd2_sigtramp);
@@ -203,7 +199,7 @@ _initialize_ppcnbsd_tdep (void)
                          ppcnbsd_init_abi);
 
   /* Avoid initializing the register offsets again if they were
-     already initailized by ppcnbsd-nat.c.  */
+     already initialized by ppcnbsd-nat.c.  */
   if (ppcnbsd_reg_offsets.pc_offset == 0)
     {
       /* General-purpose registers.  */
This page took 0.026104 seconds and 4 git commands to generate.