diff options
Diffstat (limited to 'gdb/gdbserver/linux-x86-low.c')
-rw-r--r-- | gdb/gdbserver/linux-x86-low.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c index cdd5b00..5fcc24d 100644 --- a/gdb/gdbserver/linux-x86-low.c +++ b/gdb/gdbserver/linux-x86-low.c @@ -544,12 +544,13 @@ 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); errno = 0; value = ptrace (PTRACE_PEEKUSER, tid, u_debugreg_offset (regnum), 0); if (errno != 0) - error ("Couldn't read debug register"); + perror_with_name (_("Couldn't read debug register")); return value; } @@ -559,12 +560,13 @@ 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); errno = 0; ptrace (PTRACE_POKEUSER, tid, u_debugreg_offset (regnum), value); if (errno != 0) - error ("Couldn't write debug register"); + perror_with_name (_("Couldn't write debug register")); } static int |