/* Native-dependent code for X86 BSD's.
- Copyright (C) 2003-2018 Free Software Foundation, Inc.
+ Copyright (C) 2003-2020 Free Software Foundation, Inc.
This file is part of GDB.
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),
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