* breakpoint.c (update_watchpoint): Move code to change

the enable state of breakpoint from here ...
	(do_enable_breakpoint): ... to here.
This commit is contained in:
Thiago Jung Bauermann 2011-05-03 05:02:54 +00:00
parent 007247d891
commit 1e718ff1cc
2 changed files with 10 additions and 9 deletions

View File

@ -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

View File

@ -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;