X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fgdbserver%2Fwin32-i386-low.c;h=1961a9827fb60263fe06ebd211a8a9bcf86f21dc;hb=f00a2de2a7556c59bce93f7ced44afa8e1bbf7c3;hp=03d6e1779d46c52b8b8d526410ac251063fa04ab;hpb=cc4d742f4ce05bf933397a513b953c0feeae0663;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/gdbserver/win32-i386-low.c b/gdb/gdbserver/win32-i386-low.c index 03d6e1779d..1961a9827f 100644 --- a/gdb/gdbserver/win32-i386-low.c +++ b/gdb/gdbserver/win32-i386-low.c @@ -36,23 +36,14 @@ static struct x86_debug_reg_state debug_reg_state; -static int -update_debug_registers_callback (struct inferior_list_entry *entry, - void *pid_p) +static void +update_debug_registers (thread_info *thread) { - struct thread_info *thr = (struct thread_info *) entry; - win32_thread_info *th = (win32_thread_info *) thread_target_data (thr); - int pid = *(int *) pid_p; - - /* Only update the threads of this process. */ - if (pid_of (thr) == pid) - { - /* The actual update is done later just before resuming the lwp, - we just mark that the registers need updating. */ - th->debug_registers_changed = 1; - } + win32_thread_info *th = (win32_thread_info *) thread_target_data (thread); - return 0; + /* The actual update is done later just before resuming the lwp, + we just mark that the registers need updating. */ + th->debug_registers_changed = 1; } /* Update the inferior's debug register REGNUM from STATE. */ @@ -60,12 +51,10 @@ update_debug_registers_callback (struct inferior_list_entry *entry, static void x86_dr_low_set_addr (int regnum, CORE_ADDR addr) { - /* Only update the threads of this process. */ - int pid = pid_of (current_thread); - gdb_assert (DR_FIRSTADDR <= regnum && regnum <= DR_LASTADDR); - find_inferior (&all_threads, update_debug_registers_callback, &pid); + /* Only update the threads of this process. */ + for_each_thread (current_thread->id.pid (), update_debug_registers); } /* Update the inferior's DR7 debug control register from STATE. */ @@ -74,9 +63,7 @@ static void x86_dr_low_set_control (unsigned long control) { /* Only update the threads of this process. */ - int pid = pid_of (current_thread); - - find_inferior (&all_threads, update_debug_registers_callback, &pid); + for_each_thread (current_thread->id.pid (), update_debug_registers); } /* Return the current value of a DR register of the current thread's