2008-12-26 Sandra Loosemore <sandra@codesourcery.com>

gdb/
	* breakpoint.c (update_watchpoint): Refactor to avoid compiler
	warning.
This commit is contained in:
Sandra Loosemore 2008-12-26 19:11:53 +00:00
parent 393be9d096
commit ca2d49e822
2 changed files with 15 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2008-12-26 Sandra Loosemore <sandra@codesourcery.com>
* breakpoint.c (update_watchpoint): Refactor to avoid compiler
warning.
2008-12-22 Tom Tromey <tromey@redhat.com> 2008-12-22 Tom Tromey <tromey@redhat.com>
* stack.c (print_block_frame_locals): Print spaces, not tabs. * stack.c (print_block_frame_locals): Print spaces, not tabs.

View File

@ -898,20 +898,24 @@ update_watchpoint (struct breakpoint *b, int reparse)
if ((b->type == bp_watchpoint || b->type == bp_hardware_watchpoint) if ((b->type == bp_watchpoint || b->type == bp_hardware_watchpoint)
&& reparse) && reparse)
{ {
int i, mem_cnt, target_resources_ok, other_type_used; int i, mem_cnt, other_type_used;
i = hw_watchpoint_used_count (bp_hardware_watchpoint, i = hw_watchpoint_used_count (bp_hardware_watchpoint,
&other_type_used); &other_type_used);
mem_cnt = can_use_hardware_watchpoint (val_chain); mem_cnt = can_use_hardware_watchpoint (val_chain);
if (mem_cnt) if (!mem_cnt)
target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT b->type = bp_watchpoint;
else
{
int target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT
(bp_hardware_watchpoint, i + mem_cnt, other_type_used); (bp_hardware_watchpoint, i + mem_cnt, other_type_used);
if (!mem_cnt || target_resources_ok <= 0) if (target_resources_ok <= 0)
b->type = bp_watchpoint; b->type = bp_watchpoint;
else else
b->type = bp_hardware_watchpoint; b->type = bp_hardware_watchpoint;
} }
}
/* Look at each value on the value chain. */ /* Look at each value on the value chain. */
for (v = val_chain; v; v = next) for (v = val_chain; v; v = next)