+2011-11-14 Maciej W. Rozycki <macro@codesourcery.com>
+
+ * i386-nat.c (i386_insert_hw_breakpoint): Call
+ i386_update_inferior_debug_regs.
+ (i386_remove_hw_breakpoint): Likewise.
+
2011-11-14 Yao Qi <yao@codesourcery.com>
* breakpoint.c (init_raw_breakpoint): Call
{
unsigned len_rw = i386_length_and_rw_bits (1, hw_execute);
CORE_ADDR addr = bp_tgt->placed_address;
- int retval = i386_insert_aligned_watchpoint (&dr_mirror,
+ /* Work on a local copy of the debug registers, and on success,
+ commit the change back to the inferior. */
+ struct i386_debug_reg_state local_state = dr_mirror;
+ int retval = i386_insert_aligned_watchpoint (&local_state,
addr, len_rw) ? EBUSY : 0;
+ if (retval == 0)
+ i386_update_inferior_debug_regs (&local_state);
+
if (maint_show_dr)
i386_show_dr (&dr_mirror, "insert_hwbp", addr, 1, hw_execute);
{
unsigned len_rw = i386_length_and_rw_bits (1, hw_execute);
CORE_ADDR addr = bp_tgt->placed_address;
- int retval = i386_remove_aligned_watchpoint (&dr_mirror,
+ /* Work on a local copy of the debug registers, and on success,
+ commit the change back to the inferior. */
+ struct i386_debug_reg_state local_state = dr_mirror;
+ int retval = i386_remove_aligned_watchpoint (&local_state,
addr, len_rw);
+ if (retval == 0)
+ i386_update_inferior_debug_regs (&local_state);
+
if (maint_show_dr)
i386_show_dr (&dr_mirror, "remove_hwbp", addr, 1, hw_execute);