Add assembler and disassembler support for the new Armv8.4-a registers for AArch64.
[deliverable/binutils-gdb.git] / gdb / hppa-linux-nat.c
index f38df6ebd7182e4738c19a347754b5c9ba8320aa..67f51e75359ce0c04764a7c1fe5e2a3831745a4d 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions specific to running GDB native on HPPA running GNU/Linux.
 
-   Copyright (C) 2004-2013 Free Software Foundation, Inc.
+   Copyright (C) 2004-2017 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "defs.h"
 #include "gdbcore.h"
 #include "regcache.h"
-#include <string.h>
 #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,8 +213,8 @@ static const int greg_map[] =
 static void
 fetch_register (struct regcache *regcache, int regno)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
-  int tid;
+  struct gdbarch *gdbarch = regcache->arch ();
+  pid_t tid;
   int val;
 
   if (gdbarch_cannot_fetch_register (gdbarch, regno))
@@ -223,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,17 +240,14 @@ fetch_register (struct regcache *regcache, int regno)
 static void
 store_register (const struct regcache *regcache, int regno)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
-  int tid;
+  struct gdbarch *gdbarch = regcache->arch ();
+  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);
@@ -275,7 +269,7 @@ hppa_linux_fetch_inferior_registers (struct target_ops *ops,
   if (-1 == regno)
     {
       for (regno = 0;
-          regno < gdbarch_num_regs (get_regcache_arch (regcache));
+          regno < gdbarch_num_regs (regcache->arch ());
           regno++)
         fetch_register (regcache, regno);
     }
@@ -296,7 +290,7 @@ hppa_linux_store_inferior_registers (struct target_ops *ops,
   if (-1 == regno)
     {
       for (regno = 0;
-          regno < gdbarch_num_regs (get_regcache_arch (regcache));
+          regno < gdbarch_num_regs (regcache->arch ());
           regno++)
        store_register (regcache, regno);
     }
@@ -383,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.030135 seconds and 4 git commands to generate.