Implement "to_stopped_by_hw_breakpoint" for x86 debug registers.
[deliverable/binutils-gdb.git] / gdb / mips64-obsd-nat.c
index 97af421981a61bfcdee17d9c90c3f4acfdd64ad0..d616418da1f9dcb772b749ff6754f279fb993aa6 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for OpenBSD/mips64.
 
-   Copyright (C) 2004-2017 Free Software Foundation, Inc.
+   Copyright (C) 2004-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -82,9 +82,9 @@ mips64obsd_fetch_inferior_registers (struct target_ops *ops,
                                     struct regcache *regcache, int regnum)
 {
   struct reg regs;
+  pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
 
-  if (ptrace (PT_GETREGS, ptid_get_pid (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"));
 
   mips64obsd_supply_gregset (regcache, &regs);
@@ -98,21 +98,16 @@ mips64obsd_store_inferior_registers (struct target_ops *ops,
                                     struct regcache *regcache, int regnum)
 {
   struct reg regs;
+  pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
 
-  if (ptrace (PT_GETREGS, ptid_get_pid (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"));
 
   mips64obsd_collect_gregset (regcache, &regs, regnum);
 
-  if (ptrace (PT_SETREGS, ptid_get_pid (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"));
 }
-\f
-
-/* Provide a prototype to silence -Wmissing-prototypes.  */
-void _initialize_mips64obsd_nat (void);
 
 void
 _initialize_mips64obsd_nat (void)
This page took 0.03222 seconds and 4 git commands to generate.