X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fx86-bsd-nat.c;h=b000976619ff3e21c9efd5bb1a45351249067540;hb=be6d4f74c77c6f521afc873d226480e001cb99c2;hp=542bcd060335f2509a0c9b19b7c4fff06cf9084d;hpb=f6ac5f3d63e03a81c4ff3749aba234961cc9090e;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/x86-bsd-nat.c b/gdb/x86-bsd-nat.c index 542bcd0603..b000976619 100644 --- a/gdb/x86-bsd-nat.c +++ b/gdb/x86-bsd-nat.c @@ -1,6 +1,6 @@ /* Native-dependent code for X86 BSD's. - Copyright (C) 2003-2018 Free Software Foundation, Inc. + Copyright (C) 2003-2019 Free Software Foundation, Inc. This file is part of GDB. @@ -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