[FT32] gdb: Correctly interpret function prologs
[deliverable/binutils-gdb.git] / gdb / hppanbsd-tdep.c
index d7e4e34ae577fff650e655c1c656300b91478cd5..33ae55aafd4a9f3ea3ce3a1a5f9adc75f18e10a7 100644 (file)
@@ -1,12 +1,12 @@
 /* Target-dependent code for NetBSD/hppa
 
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008-2015 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -15,9 +15,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 #include "osabi.h"
 #include "trad-frame.h"
 #include "tramp-frame.h"
 
-#include "gdb_assert.h"
-#include "gdb_string.h"
-
 #include "hppa-tdep.h"
+#include "hppabsd-tdep.h"
 
 /* From <machine/mcontext.h>.  */
 static int hppanbsd_mc_reg_offset[] =
@@ -165,11 +161,11 @@ static int hppanbsd_reg_offset[] =
    REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
 
 static void
-hppanbsd_supply_gregset (const struct regset *regset, struct regcache *regcache,
-                    int regnum, const void *gregs, size_t len)
+hppanbsd_supply_gregset (const struct regset *regset,
+                        struct regcache *regcache,
+                        int regnum, const void *gregs, size_t len)
 {
-  const gdb_byte *regs = gregs;
-  size_t offset;
+  const gdb_byte *regs = (const gdb_byte *) gregs;
   int i;
 
   gdb_assert (len >= HPPANBSD_SIZEOF_GREGS);
@@ -182,27 +178,23 @@ hppanbsd_supply_gregset (const struct regset *regset, struct regcache *regcache,
 
 /* NetBSD/hppa register set.  */
 
-static struct regset hppanbsd_gregset =
+static const struct regset hppanbsd_gregset =
 {
   NULL,
   hppanbsd_supply_gregset
 };
 
-/* Return the appropriate register set for the core section identified
-   by SECT_NAME and SECT_SIZE.  */
+/* Iterate over supported core file register note sections. */
 
-static const struct regset *
-hppanbsd_regset_from_core_section (struct gdbarch *gdbarch,
-                                 const char *sect_name, size_t sect_size)
+static void
+hppanbsd_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 >= HPPANBSD_SIZEOF_GREGS)
-    return &hppanbsd_gregset;
-
-  return NULL;
+  cb (".reg", HPPANBSD_SIZEOF_GREGS, &hppanbsd_gregset, NULL, cb_data);
 }
 \f
-void hppabsd_init_abi (struct gdbarch_info, struct gdbarch *);
-
 static void
 hppanbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
@@ -210,15 +202,15 @@ hppanbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   hppabsd_init_abi (info, gdbarch);
 
   /* Core file support.  */
-  set_gdbarch_regset_from_core_section
-    (gdbarch, hppanbsd_regset_from_core_section);
+  set_gdbarch_iterate_over_regset_sections
+    (gdbarch, hppanbsd_iterate_over_regset_sections);
 
   tramp_frame_prepend_unwinder (gdbarch, &hppanbsd_sigtramp_si4);
 }
 \f
 
 /* Provide a prototype to silence -Wmissing-prototypes.  */
-void _initialize_hppabsd_tdep (void);
+extern initialize_file_ftype _initialize_hppanbsd_tdep;
 
 void
 _initialize_hppanbsd_tdep (void)
This page took 0.026519 seconds and 4 git commands to generate.