* i386-linux-tdep.c (I386_LINUX_RECORD_SIZE_*,
[deliverable/binutils-gdb.git] / gdb / shnbsd-tdep.c
index 5108fc4ef6d8c883d64e6713785152b98ddd2f10..a0cddc5b6a9117d3ab4ce5ee84fbf68b60d15e87 100644 (file)
@@ -1,6 +1,7 @@
 /* Target-dependent code for NetBSD/sh.
 
-   Copyright (C) 2002, 2003, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2006, 2007, 2008, 2009
+   Free Software Foundation, Inc.
 
    Contributed by Wasabi Systems, Inc.
 
@@ -8,7 +9,7 @@
 
    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,
@@ -17,9 +18,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 "gdbcore.h"
@@ -69,13 +68,15 @@ shnbsd_supply_gregset (const struct regset *regset,
                       struct regcache *regcache,
                       int regnum, const void *gregs, size_t len)
 {
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
   const gdb_byte *regs = gregs;
   int i;
 
   gdb_assert (len >= SHNBSD_SIZEOF_GREGS);
 
-  if (regnum == PC_REGNUM || regnum == -1)
-    regcache_raw_supply (regcache, PC_REGNUM, regs + (0 * 4));
+  if (regnum == gdbarch_pc_regnum (gdbarch) || regnum == -1)
+    regcache_raw_supply (regcache, gdbarch_pc_regnum (gdbarch),
+                        regs + (0 * 4));
 
   if (regnum == SR_REGNUM || regnum == -1)
     regcache_raw_supply (regcache, SR_REGNUM, regs + (1 * 4));
@@ -106,13 +107,15 @@ shnbsd_collect_gregset (const struct regset *regset,
                        const struct regcache *regcache,
                        int regnum, void *gregs, size_t len)
 {
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
   gdb_byte *regs = gregs;
   int i;
 
   gdb_assert (len >= SHNBSD_SIZEOF_GREGS);
 
-  if (regnum == PC_REGNUM || regnum == -1)
-    regcache_raw_collect (regcache, PC_REGNUM, regs + (0 * 4));
+  if (regnum == gdbarch_pc_regnum (gdbarch) || regnum == -1)
+    regcache_raw_collect (regcache, gdbarch_pc_regnum (gdbarch),
+                         regs + (0 * 4));
 
   if (regnum == SR_REGNUM || regnum == -1)
     regcache_raw_collect (regcache, SR_REGNUM, regs + (1 * 4));
@@ -145,7 +148,7 @@ static struct regset shnbsd_gregset =
 /* Return the appropriate register set for the core section identified
    by SECT_NAME and SECT_SIZE.  */
 
-const struct regset *
+static const struct regset *
 shnbsd_regset_from_core_section (struct gdbarch *gdbarch,
                                 const char *sect_name, size_t sect_size)
 {
@@ -195,6 +198,9 @@ shnbsd_core_osabi_sniffer (bfd *abfd)
   return GDB_OSABI_UNKNOWN;
 }
 
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+extern initialize_file_ftype _initialize_shnbsd_tdep;
+
 void
 _initialize_shnbsd_tdep (void)
 {
This page took 0.027263 seconds and 4 git commands to generate.