X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fnat%2Fx86-linux-dregs.c;h=29b4ee16b60aeb6a8067f0b0308ef9dcf2e079a7;hb=8e5cb9a54e156ba24a439aefa7b35e53b4cb0374;hp=93898033a6602313fe545986c90a1c9f200a5e6a;hpb=8e5d40700492597d103ebdb68eab733456b66fad;p=deliverable%2Fbinutils-gdb.git
diff --git a/gdb/nat/x86-linux-dregs.c b/gdb/nat/x86-linux-dregs.c
index 93898033a6..29b4ee16b6 100644
--- a/gdb/nat/x86-linux-dregs.c
+++ b/gdb/nat/x86-linux-dregs.c
@@ -1,6 +1,6 @@
/* Low-level debug register code for GNU/Linux x86 (i386 and x86-64).
- Copyright (C) 1999-2015 Free Software Foundation, Inc.
+ Copyright (C) 1999-2019 Free Software Foundation, Inc.
This file is part of GDB.
@@ -17,8 +17,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
-#include "common-defs.h"
-#include
+#include "common/common-defs.h"
+#include "nat/gdb_ptrace.h"
#include
#include "target/waitstatus.h"
#include "nat/x86-linux.h"
@@ -43,8 +43,8 @@ x86_linux_dr_get (ptid_t ptid, int regnum)
int tid;
unsigned long value;
- gdb_assert (ptid_lwp_p (ptid));
- tid = ptid_get_lwp (ptid);
+ gdb_assert (ptid.lwp_p ());
+ tid = ptid.lwp ();
errno = 0;
value = ptrace (PTRACE_PEEKUSER, tid, u_debugreg_offset (regnum), 0);
@@ -61,8 +61,8 @@ x86_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
{
int tid;
- gdb_assert (ptid_lwp_p (ptid));
- tid = ptid_get_lwp (ptid);
+ gdb_assert (ptid.lwp_p ());
+ tid = ptid.lwp ();
errno = 0;
ptrace (PTRACE_POKEUSER, tid, u_debugreg_offset (regnum), value);
@@ -76,7 +76,7 @@ x86_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
the actual debug registers immediately prior to LWP resuming. */
static int
-update_debug_registers_callback (struct lwp_info *lwp, void *arg)
+update_debug_registers_callback (struct lwp_info *lwp)
{
lwp_set_debug_registers_changed (lwp, 1);
@@ -102,11 +102,11 @@ x86_linux_dr_get_addr (int regnum)
void
x86_linux_dr_set_addr (int regnum, CORE_ADDR addr)
{
- ptid_t pid_ptid = pid_to_ptid (ptid_get_pid (current_lwp_ptid ()));
+ ptid_t pid_ptid = ptid_t (current_lwp_ptid ().pid ());
gdb_assert (DR_FIRSTADDR <= regnum && regnum <= DR_LASTADDR);
- iterate_over_lwps (pid_ptid, update_debug_registers_callback, NULL);
+ iterate_over_lwps (pid_ptid, update_debug_registers_callback);
}
/* See nat/x86-linux-dregs.h. */
@@ -122,9 +122,9 @@ x86_linux_dr_get_control (void)
void
x86_linux_dr_set_control (unsigned long control)
{
- ptid_t pid_ptid = pid_to_ptid (ptid_get_pid (current_lwp_ptid ()));
+ ptid_t pid_ptid = ptid_t (current_lwp_ptid ().pid ());
- iterate_over_lwps (pid_ptid, update_debug_registers_callback, NULL);
+ iterate_over_lwps (pid_ptid, update_debug_registers_callback);
}
/* See nat/x86-linux-dregs.h. */
@@ -148,7 +148,7 @@ x86_linux_update_debug_registers (struct lwp_info *lwp)
if (lwp_debug_registers_changed (lwp))
{
struct x86_debug_reg_state *state
- = x86_debug_reg_state (ptid_get_pid (ptid));
+ = x86_debug_reg_state (ptid.pid ());
int i;
/* Prior to Linux kernel 2.6.33 commit