bfd_set_input_error
[deliverable/binutils-gdb.git] / gdb / hppa-linux-nat.c
index cfadf73c1c0256edd4c05b831839142114c79aec..c190a4bf35e9e92df00f84959362f2baf5f7484c 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions specific to running GDB native on HPPA running GNU/Linux.
 
-   Copyright (C) 2004-2015 Free Software Foundation, Inc.
+   Copyright (C) 2004-2017 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "inferior.h"
 #include "target.h"
 #include "linux-nat.h"
+#include "inf-ptrace.h"
 
 #include <sys/procfs.h>
-#include <sys/ptrace.h>
+#include "nat/gdb_ptrace.h"
 #include <linux/version.h>
 
 #include <asm/ptrace.h>
@@ -213,7 +214,7 @@ static void
 fetch_register (struct regcache *regcache, int regno)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
-  int tid;
+  pid_t tid;
   int val;
 
   if (gdbarch_cannot_fetch_register (gdbarch, regno))
@@ -222,10 +223,7 @@ fetch_register (struct regcache *regcache, int regno)
       return;
     }
 
-  /* GNU/Linux LWP ID's are process ID's.  */
-  tid = ptid_get_lwp (inferior_ptid);
-  if (tid == 0)
-    tid = ptid_get_pid (inferior_ptid); /* Not a threaded program.  */
+  tid = get_ptrace_pid (regcache_get_ptid (regcache));
 
   errno = 0;
   val = ptrace (PTRACE_PEEKUSER, tid, hppa_linux_register_addr (regno, 0), 0);
@@ -243,16 +241,13 @@ static void
 store_register (const struct regcache *regcache, int regno)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
-  int tid;
+  pid_t tid;
   int val;
 
   if (gdbarch_cannot_store_register (gdbarch, regno))
     return;
 
-  /* GNU/Linux LWP ID's are process ID's.  */
-  tid = ptid_get_lwp (inferior_ptid);
-  if (tid == 0)
-    tid = ptid_get_pid (inferior_ptid); /* Not a threaded program.  */
+  tid = get_ptrace_pid (regcache_get_ptid (regcache));
 
   errno = 0;
   regcache_raw_collect (regcache, regno, &val);
@@ -382,8 +377,6 @@ fill_fpregset (const struct regcache *regcache,
    }
 }
 
-void _initialize_hppa_linux_nat (void);
-
 void
 _initialize_hppa_linux_nat (void)
 {
This page took 0.02789 seconds and 4 git commands to generate.