Automatic date update in version.in
[deliverable/binutils-gdb.git] / gdb / m32r-linux-nat.c
index 753b47223f48ab7b974a9221f4e39f2b212d2e88..e5dbfb9832174595f37a0b5ec7a0486a5c4dd24d 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for GNU/Linux m32r.
 
-   Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2004-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "regcache.h"
 #include "linux-nat.h"
 #include "target.h"
-
-#include "gdb_assert.h"
-#include "gdb_string.h"
-#include <sys/ptrace.h>
+#include "nat/gdb_ptrace.h"
 #include <sys/user.h>
 #include <sys/procfs.h>
+#include "inf-ptrace.h"
 
 /* Prototypes for supply_gregset etc.  */
 #include "gregset.h"
@@ -55,8 +53,9 @@ static int regmap[] = {
 #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
 
 
@@ -193,14 +192,10 @@ fill_fpregset (const struct regcache *regcache,
    registers).  */
 
 static void
-m32r_linux_fetch_inferior_registers (struct regcache *regcache, int regno)
+m32r_linux_fetch_inferior_registers (struct target_ops *ops,
+                                    struct regcache *regcache, int regno)
 {
-  int tid;
-
-  /* GNU/Linux LWP ID's are process ID's.  */
-  tid = TIDGET (inferior_ptid);
-  if (tid == 0)
-    tid = PIDGET (inferior_ptid);      /* Not a threaded program.  */
+  pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
 
   /* Use the PTRACE_GETREGS request whenever possible, since it
      transfers more registers in one system call, and we'll cache the
@@ -219,13 +214,10 @@ m32r_linux_fetch_inferior_registers (struct regcache *regcache, int regno)
    do this for all registers (including the floating point and SSE
    registers).  */
 static void
-m32r_linux_store_inferior_registers (struct regcache *regcache, int regno)
+m32r_linux_store_inferior_registers (struct target_ops *ops,
+                                    struct regcache *regcache, int regno)
 {
-  int tid;
-
-  /* GNU/Linux LWP ID's are process ID's.  */
-  if ((tid = TIDGET (inferior_ptid)) == 0)
-    tid = PIDGET (inferior_ptid);      /* Not a threaded program.  */
+  pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
 
   /* Use the PTRACE_SETREGS request whenever possible, since it
      transfers more registers in one system call.  */
@@ -239,8 +231,6 @@ m32r_linux_store_inferior_registers (struct regcache *regcache, int regno)
                  _("Got request to store bad register number %d."), regno);
 }
 
-void _initialize_m32r_linux_nat (void);
-
 void
 _initialize_m32r_linux_nat (void)
 {
This page took 0.024545 seconds and 4 git commands to generate.