summaryrefslogtreecommitdiff
path: root/gdb/x86-bsd-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/x86-bsd-nat.c')
-rw-r--r--gdb/x86-bsd-nat.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gdb/x86-bsd-nat.c b/gdb/x86-bsd-nat.c
index 542bcd06033..47ebff46c8c 100644
--- a/gdb/x86-bsd-nat.c
+++ b/gdb/x86-bsd-nat.c
@@ -67,7 +67,6 @@ x86bsd_dr_get (ptid_t ptid, int regnum)
static void
x86bsd_dr_set (int regnum, unsigned long value)
{
- struct thread_info *thread;
struct dbreg dbregs;
if (ptrace (PT_GETDBREGS, get_ptrace_pid (inferior_ptid),
@@ -81,13 +80,12 @@ x86bsd_dr_set (int regnum, unsigned long value)
DBREG_DRX ((&dbregs), regnum) = value;
- ALL_NON_EXITED_THREADS (thread)
- if (thread->inf == current_inferior ())
- {
- if (ptrace (PT_SETDBREGS, get_ptrace_pid (thread->ptid),
- (PTRACE_TYPE_ARG3) &dbregs, 0) == -1)
- perror_with_name (_("Couldn't write debug registers"));
- }
+ for (thread_info *thread : current_inferior ()->non_exited_threads ())
+ {
+ if (ptrace (PT_SETDBREGS, get_ptrace_pid (thread->ptid),
+ (PTRACE_TYPE_ARG3) &dbregs, 0) == -1)
+ perror_with_name (_("Couldn't write debug registers"));
+ }
}
static void