diff options
author | Thiago Jung Bauermann <bauerman@br.ibm.com> | 2011-05-03 05:02:54 +0000 |
---|---|---|
committer | Thiago Jung Bauermann <bauerman@br.ibm.com> | 2011-05-03 05:02:54 +0000 |
commit | 1e718ff1cc2a3eb7e63da14ae8c425570fbfa270 (patch) | |
tree | 51c676db1e6ade3aeb1fc93ae348851afd93ded4 | |
parent | 007247d891e93bd4e5a0ead82ab8753c84374736 (diff) | |
download | gdb-1e718ff1cc2a3eb7e63da14ae8c425570fbfa270.zip gdb-1e718ff1cc2a3eb7e63da14ae8c425570fbfa270.tar.gz gdb-1e718ff1cc2a3eb7e63da14ae8c425570fbfa270.tar.bz2 |
* breakpoint.c (update_watchpoint): Move code to change
the enable state of breakpoint from here ...
(do_enable_breakpoint): ... to here.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/breakpoint.c | 13 |
2 files changed, 10 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0828d17..32c6491 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2011-05-03 Thiago Jung Bauermann <bauerman@br.ibm.com> + + * breakpoint.c (update_watchpoint): Move code to change + the enable state of breakpoint from here ... + (do_enable_breakpoint): ... to here. + 2011-04-26 Andrew Gontarek <andrewg@cray.com> * valprint.c (val_print_array_elements): Fixed poor performance diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index b9d76c7..e265135 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -1416,7 +1416,6 @@ update_watchpoint (struct breakpoint *b, int reparse) if (reg_cnt) { int i, target_resources_ok, other_type_used; - enum enable_state orig_enable_state; /* We need to determine how many resources are already used for all other hardware watchpoints plus this one @@ -1427,17 +1426,9 @@ update_watchpoint (struct breakpoint *b, int reparse) watchpoint. */ b->type = bp_hardware_watchpoint; - /* hw_watchpoint_used_count ignores disabled watchpoints, - and b might be disabled if we're being called from - do_enable_breakpoint. */ - orig_enable_state = b->enable_state; - b->enable_state = bp_enabled; - i = hw_watchpoint_used_count (bp_hardware_watchpoint, &other_type_used); - b->enable_state = orig_enable_state; - target_resources_ok = target_can_use_hardware_watchpoint (bp_hardware_watchpoint, i, other_type_used); if (target_resources_ok <= 0) @@ -11477,14 +11468,18 @@ do_enable_breakpoint (struct breakpoint *bpt, enum bpdisp disposition) if (is_watchpoint (bpt)) { + enum enable_state orig_enable_state; struct gdb_exception e; TRY_CATCH (e, RETURN_MASK_ALL) { + orig_enable_state = bpt->enable_state; + bpt->enable_state = bp_enabled; update_watchpoint (bpt, 1 /* reparse */); } if (e.reason < 0) { + bpt->enable_state = orig_enable_state; exception_fprintf (gdb_stderr, e, _("Cannot enable watchpoint %d: "), bpt->number); return; |