2008-12-26 Sandra Loosemore <sandra@codesourcery.com>
authorSandra Loosemore <sandra@codesourcery.com>
Fri, 26 Dec 2008 19:11:53 +0000 (19:11 +0000)
committerSandra Loosemore <sandra@codesourcery.com>
Fri, 26 Dec 2008 19:11:53 +0000 (19:11 +0000)
gdb/
* breakpoint.c (update_watchpoint): Refactor to avoid compiler
warning.

gdb/ChangeLog
gdb/breakpoint.c

index 8994407bbcc1da2b61a2960378e5fa9403333150..c78678b7bcf61973d7905cb805e30bab6d7e8671 100644 (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>
 
        * stack.c (print_block_frame_locals): Print spaces, not tabs.
index d0619c1a40f4272876e69d35915187e445776f14..30c89bd1db981412dfb499452004ee9484ec1ce8 100644 (file)
@@ -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.  */