aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2011-11-14 13:11:58 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2011-11-14 13:11:58 +0000
commitedcc485a366503e7591c65dd1504cc40e028b0f5 (patch)
tree7892c0215c72177395187a63446f4a346599048b
parent3742cc8b4f7c8bd53a9ec513dd52189fb50c1b69 (diff)
downloadgdb-edcc485a366503e7591c65dd1504cc40e028b0f5.zip
gdb-edcc485a366503e7591c65dd1504cc40e028b0f5.tar.gz
gdb-edcc485a366503e7591c65dd1504cc40e028b0f5.tar.bz2
* i386-nat.c (i386_insert_hw_breakpoint): Call
i386_update_inferior_debug_regs. (i386_remove_hw_breakpoint): Likewise.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/i386-nat.c16
2 files changed, 20 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ac9de9d..d77e92d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+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
diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c
index e27a1a0..568b79b 100644
--- a/gdb/i386-nat.c
+++ b/gdb/i386-nat.c
@@ -684,9 +684,15 @@ i386_insert_hw_breakpoint (struct gdbarch *gdbarch,
{
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);
@@ -702,9 +708,15 @@ i386_remove_hw_breakpoint (struct gdbarch *gdbarch,
{
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);