gdb/testsuite/
[deliverable/binutils-gdb.git] / gdb / m32r-linux-nat.c
index 32d3de91403560f68621d75fbf7bfdc6358473ca..05f338809dd7a4124527ddea870f2589e1c947fc 100644 (file)
@@ -1,12 +1,13 @@
 /* Native-dependent code for GNU/Linux m32r.
 
 /* Native-dependent code for GNU/Linux m32r.
 
-   Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   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
 
    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,
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -15,9 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    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 "inferior.h"
 
 #include "defs.h"
 #include "inferior.h"
@@ -57,8 +56,9 @@ static int regmap[] = {
 #define SPU_REGMAP 23
 #define SPI_REGMAP 26
 
 #define SPU_REGMAP 23
 #define SPI_REGMAP 26
 
-/* Doee apply to the corresponding SET requests as well.  */
-#define GETREGS_SUPPLIES(regno) (0 <= (regno) && (regno) <= M32R_LINUX_NUM_REGS)
+/* Doee (??) apply to the corresponding SET requests as well.  */
+#define GETREGS_SUPPLIES(regno) (0 <= (regno) \
+                                && (regno) <= M32R_LINUX_NUM_REGS)
 \f
 
 
 \f
 
 
@@ -108,14 +108,14 @@ supply_gregset (struct regcache *regcache, const elf_gregset_t * gregsetp)
    store their values in GDB's register array.  */
 
 static void
    store their values in GDB's register array.  */
 
 static void
-fetch_regs (int tid)
+fetch_regs (struct regcache *regcache, int tid)
 {
   elf_gregset_t regs;
 
   if (ptrace (PTRACE_GETREGS, tid, 0, (int) &regs) < 0)
     perror_with_name (_("Couldn't get registers"));
 
 {
   elf_gregset_t regs;
 
   if (ptrace (PTRACE_GETREGS, tid, 0, (int) &regs) < 0)
     perror_with_name (_("Couldn't get registers"));
 
-  supply_gregset (current_regcache, (const elf_gregset_t *) &regs);
+  supply_gregset (regcache, (const elf_gregset_t *) &regs);
 }
 
 /* Fill register REGNO (if it is a general-purpose register) in
 }
 
 /* Fill register REGNO (if it is a general-purpose register) in
@@ -157,14 +157,14 @@ fill_gregset (const struct regcache *regcache,
    into the process/thread specified by TID.  */
 
 static void
    into the process/thread specified by TID.  */
 
 static void
-store_regs (int tid, int regno)
+store_regs (const struct regcache *regcache, int tid, int regno)
 {
   elf_gregset_t regs;
 
   if (ptrace (PTRACE_GETREGS, tid, 0, (int) &regs) < 0)
     perror_with_name (_("Couldn't get registers"));
 
 {
   elf_gregset_t regs;
 
   if (ptrace (PTRACE_GETREGS, tid, 0, (int) &regs) < 0)
     perror_with_name (_("Couldn't get registers"));
 
-  fill_gregset (current_regcache, &regs, regno);
+  fill_gregset (regcache, &regs, regno);
 
   if (ptrace (PTRACE_SETREGS, tid, 0, (int) &regs) < 0)
     perror_with_name (_("Couldn't write registers"));
 
   if (ptrace (PTRACE_SETREGS, tid, 0, (int) &regs) < 0)
     perror_with_name (_("Couldn't write registers"));
@@ -195,7 +195,8 @@ fill_fpregset (const struct regcache *regcache,
    registers).  */
 
 static void
    registers).  */
 
 static void
-m32r_linux_fetch_inferior_registers (int regno)
+m32r_linux_fetch_inferior_registers (struct target_ops *ops,
+                                    struct regcache *regcache, int regno)
 {
   int tid;
 
 {
   int tid;
 
@@ -209,7 +210,7 @@ m32r_linux_fetch_inferior_registers (int regno)
      results.  */
   if (regno == -1 || GETREGS_SUPPLIES (regno))
     {
      results.  */
   if (regno == -1 || GETREGS_SUPPLIES (regno))
     {
-      fetch_regs (tid);
+      fetch_regs (regcache, tid);
       return;
     }
 
       return;
     }
 
@@ -221,7 +222,8 @@ m32r_linux_fetch_inferior_registers (int regno)
    do this for all registers (including the floating point and SSE
    registers).  */
 static void
    do this for all registers (including the floating point and SSE
    registers).  */
 static void
-m32r_linux_store_inferior_registers (int regno)
+m32r_linux_store_inferior_registers (struct target_ops *ops,
+                                    struct regcache *regcache, int regno)
 {
   int tid;
 
 {
   int tid;
 
@@ -233,7 +235,7 @@ m32r_linux_store_inferior_registers (int regno)
      transfers more registers in one system call.  */
   if (regno == -1 || GETREGS_SUPPLIES (regno))
     {
      transfers more registers in one system call.  */
   if (regno == -1 || GETREGS_SUPPLIES (regno))
     {
-      store_regs (tid, regno);
+      store_regs (regcache, tid, regno);
       return;
     }
 
       return;
     }
 
This page took 0.024665 seconds and 4 git commands to generate.