This is the mail archive of the
mailing list for the GDB project.
src/gdb/gdbserver ChangeLog win32-i386-low.c
- From: brobecke at sourceware dot org
- To: gdb-cvs at sourceware dot org
- Date: 7 Nov 2011 14:45:09 -0000
- Subject: src/gdb/gdbserver ChangeLog win32-i386-low.c
Module name: src
Changes by: email@example.com 2011-11-07 14:45:09
gdb/gdbserver : ChangeLog win32-i386-low.c
[gdbserver] Fix watchpoint support on Windows
Watchpoint support doesn't work anymore when using gdbserver on Windows.
They just never trigger.
The problem comes from the fact that we always set the debug registers
to zero, no matter what. This in turn comes from the fact that we
use i386_low_insert_watchpoint to compute the DR values:
return i386_low_insert_watchpoint (&debug_reg_state,
type, addr, len);
This function saves the new values in debug_reg_state. However,
the values we actually use when setting the DR registers are
taken from two different globals:
static unsigned dr_status_mirror;
static unsigned dr_control_mirror;
These are really never actually changed (their value is set from
the DR values read from the inferior, but since we never change
them, in practice, they never change).
The fix is to use the values provided by debug_reg_state, and
to eliminate the two dr_[...] globals.
* win32-i386-low.c (dr_status_mirror, dr_control_mirror): Delete.
(i386_dr_low_get_control, i386_dr_low_get_status): Use
dr_status_mirror and dr_control_mirror from debug_reg_state.
(i386_dr_low_get_status): Use debug_reg_state.dr_status_mirror
(i386_initial_stuff): Remove use of deleted globals.
i386_thread_added): Use dr_status_mirror and dr_control_mirror