Explicitly include <array> for std::array<>.
[deliverable/binutils-gdb.git] / gdb / ppc-fbsd-nat.c
index 6eed99869ff6b0ec714ed8eb89dd2dd56dae0cd7..ae5877af9f8a7e0e46fb02a4c8cba0550b4f88bb 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for PowerPC's running FreeBSD, for GDB.
 
-   Copyright (C) 2013-2016 Free Software Foundation, Inc.
+   Copyright (C) 2013-2017 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -120,9 +120,9 @@ ppcfbsd_fetch_inferior_registers (struct target_ops *ops,
                                  struct regcache *regcache, int regno)
 {
   gdb_gregset_t regs;
+  pid_t pid = ptid_get_lwp (regcache_get_ptid (regcache));
 
-  if (ptrace (PT_GETREGS, ptid_get_lwp (inferior_ptid),
-             (PTRACE_TYPE_ARG3) &regs, 0) == -1)
+  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
     perror_with_name (_("Couldn't get registers"));
 
   supply_gregset (regcache, &regs);
@@ -132,8 +132,7 @@ ppcfbsd_fetch_inferior_registers (struct target_ops *ops,
       const struct regset *fpregset = ppc_fbsd_fpregset ();
       gdb_fpregset_t fpregs;
 
-      if (ptrace (PT_GETFPREGS, ptid_get_lwp (inferior_ptid),
-                 (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+      if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
        perror_with_name (_("Couldn't get FP registers"));
 
       ppc_supply_fpregset (fpregset, regcache, regno, &fpregs, sizeof fpregs);
@@ -148,29 +147,26 @@ ppcfbsd_store_inferior_registers (struct target_ops *ops,
                                  struct regcache *regcache, int regno)
 {
   gdb_gregset_t regs;
+  pid_t pid = ptid_get_lwp (regcache_get_ptid (regcache));
 
-  if (ptrace (PT_GETREGS, ptid_get_lwp (inferior_ptid),
-             (PTRACE_TYPE_ARG3) &regs, 0) == -1)
+  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
     perror_with_name (_("Couldn't get registers"));
 
   fill_gregset (regcache, &regs, regno);
 
-  if (ptrace (PT_SETREGS, ptid_get_lwp (inferior_ptid),
-             (PTRACE_TYPE_ARG3) &regs, 0) == -1)
+  if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
     perror_with_name (_("Couldn't write registers"));
 
   if (regno == -1 || getfpregs_supplies (get_regcache_arch (regcache), regno))
     {
       gdb_fpregset_t fpregs;
 
-      if (ptrace (PT_GETFPREGS, ptid_get_lwp (inferior_ptid),
-                 (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+      if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
        perror_with_name (_("Couldn't get FP registers"));
 
       fill_fpregset (regcache, &fpregs, regno);
 
-      if (ptrace (PT_SETFPREGS, ptid_get_lwp (inferior_ptid),
-                 (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+      if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
        perror_with_name (_("Couldn't set FP registers"));
     }
 }
This page took 0.024228 seconds and 4 git commands to generate.