2002-09-29 Andrew Cagney * breakpoint.c (watch_command_1): Save mem_cnt in watchpoint. (hw_watchpoint_used_count): Accumulate the mem_cnt's * breakpoint.h: Update copyright. (struct breakpoint): Add field mem_cnt; Index: breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.90 diff -u -r1.90 breakpoint.c --- breakpoint.c 22 Sep 2002 20:29:52 -0000 1.90 +++ breakpoint.c 30 Sep 2002 03:09:42 -0000 @@ -4288,13 +4288,15 @@ { if (b->enable_state == bp_enabled) { - if (b->type == type) - i++; - else if ((b->type == bp_hardware_watchpoint || - b->type == bp_read_watchpoint || - b->type == bp_access_watchpoint) - && b->enable_state == bp_enabled) - *other_type_used = 1; + if (b->type == bp_hardware_watchpoint + || b->type == bp_read_watchpoint + || b->type == bp_access_watchpoint) + { + if (b->type == type) + i += b->mem_cnt; + else + *other_type_used = 1; + } } } return i; @@ -5384,6 +5386,7 @@ b->exp_valid_block = exp_valid_block; b->exp_string = savestring (exp_start, exp_end - exp_start); b->val = val; + b->mem_cnt = mem_cnt; b->cond = cond; if (cond_start) b->cond_string = savestring (cond_start, cond_end - cond_start); Index: breakpoint.h =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.h,v retrieving revision 1.13 diff -u -r1.13 breakpoint.h --- breakpoint.h 16 Aug 2002 15:37:54 -0000 1.13 +++ breakpoint.h 30 Sep 2002 03:11:51 -0000 @@ -1,6 +1,7 @@ /* Data structures associated with breakpoints in GDB. - Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 - Free Software Foundation, Inc. + + Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, + 2002 Free Software Foundation, Inc. This file is part of GDB. @@ -260,6 +261,11 @@ struct block *exp_valid_block; /* Value of the watchpoint the last time we checked it. */ struct value *val; + + /* Count of memory watchpoint resources needed. An expression can + refer to more than one location and hence may require more than + one memory watchpoint. */ + int mem_cnt; /* Holds the value chain for a hardware watchpoint expression. */ struct value *val_chain;