+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
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
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)
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;