bfd/
[deliverable/binutils-gdb.git] / gdb / m68klinux-nat.c
index 9729d89b809d53b353bd7c0d2c8b1cd6f5b3c64f..0da875e4c168639e85df370a36013d25f62e2f94 100644 (file)
@@ -1,7 +1,7 @@
 /* Motorola m68k native support for GNU/Linux.
 
-   Copyright 1996, 1998, 2000, 2001, 2002 Free Software Foundation,
-   Inc.
+   Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -17,8 +17,8 @@
 
    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., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -27,6 +27,8 @@
 #include "gdbcore.h"
 #include "gdb_string.h"
 #include "regcache.h"
+#include "target.h"
+#include "linux-nat.h"
 
 #include "m68k-tdep.h"
 
@@ -170,7 +172,7 @@ fetch_register (int regno)
    If REGNO is negative, do this for all registers.
    Otherwise, REGNO specifies which register (so we can save time). */
 
-void
+static void
 old_fetch_inferior_registers (int regno)
 {
   if (regno >= 0)
@@ -237,7 +239,7 @@ store_register (int regno)
    If REGNO is negative, do this for all registers.
    Otherwise, REGNO specifies which register (so we can save time).  */
 
-void
+static void
 old_store_inferior_registers (int regno)
 {
   if (regno >= 0)
@@ -317,7 +319,7 @@ fetch_regs (int tid)
          return;
        }
 
-      perror_with_name ("Couldn't get registers");
+      perror_with_name (_("Couldn't get registers"));
     }
 
   supply_gregset (&regs);
@@ -332,12 +334,12 @@ store_regs (int tid, int regno)
   elf_gregset_t regs;
 
   if (ptrace (PTRACE_GETREGS, tid, 0, (int) &regs) < 0)
-    perror_with_name ("Couldn't get registers");
+    perror_with_name (_("Couldn't get registers"));
 
   fill_gregset (&regs, regno);
 
   if (ptrace (PTRACE_SETREGS, tid, 0, (int) &regs) < 0)
-    perror_with_name ("Couldn't write registers");
+    perror_with_name (_("Couldn't write registers"));
 }
 
 #else
@@ -405,7 +407,7 @@ fetch_fpregs (int tid)
   elf_fpregset_t fpregs;
 
   if (ptrace (PTRACE_GETFPREGS, tid, 0, (int) &fpregs) < 0)
-    perror_with_name ("Couldn't get floating point status");
+    perror_with_name (_("Couldn't get floating point status"));
 
   supply_fpregset (&fpregs);
 }
@@ -419,12 +421,12 @@ store_fpregs (int tid, int regno)
   elf_fpregset_t fpregs;
 
   if (ptrace (PTRACE_GETFPREGS, tid, 0, (int) &fpregs) < 0)
-    perror_with_name ("Couldn't get floating point status");
+    perror_with_name (_("Couldn't get floating point status"));
 
   fill_fpregset (&fpregs, regno);
 
   if (ptrace (PTRACE_SETFPREGS, tid, 0, (int) &fpregs) < 0)
-    perror_with_name ("Couldn't write floating point status");
+    perror_with_name (_("Couldn't write floating point status"));
 }
 
 #else
@@ -442,8 +444,8 @@ static void store_fpregs (int tid, int regno) {}
    this for all registers (including the floating point and SSE
    registers).  */
 
-void
-fetch_inferior_registers (int regno)
+static void
+m68k_linux_fetch_inferior_registers (int regno)
 {
   int tid;
 
@@ -492,14 +494,14 @@ fetch_inferior_registers (int regno)
     }
 
   internal_error (__FILE__, __LINE__,
-                 "Got request for bad register number %d.", regno);
+                 _("Got request for bad register number %d."), regno);
 }
 
 /* Store register REGNO back into the child process.  If REGNO is -1,
    do this for all registers (including the floating point and SSE
    registers).  */
-void
-store_inferior_registers (int regno)
+static void
+m68k_linux_store_inferior_registers (int regno)
 {
   int tid;
 
@@ -539,7 +541,7 @@ store_inferior_registers (int regno)
     }
 
   internal_error (__FILE__, __LINE__,
-                 "Got request to store bad register number %d.", regno);
+                 _("Got request to store bad register number %d."), regno);
 }
 \f
 /* Interpreting register set info found in core files.  */
@@ -616,8 +618,22 @@ static struct core_fns linux_elf_core_fns =
   NULL                                 /* next */
 };
 
+void _initialize_m68k_linux_nat (void);
+
 void
 _initialize_m68k_linux_nat (void)
 {
+  struct target_ops *t;
+
+  /* Fill in the generic GNU/Linux methods.  */
+  t = linux_target ();
+
+  /* Add our register access methods.  */
+  t->to_fetch_registers = m68k_linux_fetch_inferior_registers;
+  t->to_store_registers = m68k_linux_store_inferior_registers;
+
+  /* Register the target.  */
+  linux_nat_add_target (t);
+
   deprecated_add_core_fns (&linux_elf_core_fns);
 }
This page took 0.025633 seconds and 4 git commands to generate.