From 4941be4d1396562382640da4a2e8dd2ba718b317 Mon Sep 17 00:00:00 2001 From: Sandra Loosemore Date: Fri, 26 Dec 2008 19:11:53 +0000 Subject: [PATCH] 2008-12-26 Sandra Loosemore gdb/ * breakpoint.c (update_watchpoint): Refactor to avoid compiler warning. --- gdb/ChangeLog | 5 +++++ gdb/breakpoint.c | 16 ++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8994407bbc..c78678b7bc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2008-12-26 Sandra Loosemore + + * breakpoint.c (update_watchpoint): Refactor to avoid compiler + warning. + 2008-12-22 Tom Tromey * stack.c (print_block_frame_locals): Print spaces, not tabs. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index d0619c1a40..30c89bd1db 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -898,19 +898,23 @@ update_watchpoint (struct breakpoint *b, int reparse) if ((b->type == bp_watchpoint || b->type == bp_hardware_watchpoint) && 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, &other_type_used); mem_cnt = can_use_hardware_watchpoint (val_chain); - if (mem_cnt) - target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT - (bp_hardware_watchpoint, i + mem_cnt, other_type_used); - if (!mem_cnt || target_resources_ok <= 0) + if (!mem_cnt) b->type = bp_watchpoint; else - b->type = bp_hardware_watchpoint; + { + int target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT + (bp_hardware_watchpoint, i + mem_cnt, other_type_used); + if (target_resources_ok <= 0) + b->type = bp_watchpoint; + else + b->type = bp_hardware_watchpoint; + } } /* Look at each value on the value chain. */ -- 2.11.0