gdb: Fix build failure with GCC 7
[deliverable/binutils-gdb.git] / gdb / m32r-linux-nat.c
index e5f755b9010277492d9e046414d38084b6df7525..a33de23dc3296afc3ed34b4422cbebabff127521 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for GNU/Linux m32r.
 
-   Copyright (C) 2004-2013 Free Software Foundation, Inc.
+   Copyright (C) 2004-2017 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"
@@ -197,12 +195,7 @@ static void
 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
@@ -224,11 +217,7 @@ static void
 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.  */
This page took 0.028481 seconds and 4 git commands to generate.