From 60e1c644b75b371c61367bc4abf0b7ad93b2d236 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 10 Mar 2010 13:25:40 +0000 Subject: gdb/ * breakpoint.c (condition_command): Handle watchpoint conditions. (is_hardware_watchpoint): Add comment. (is_watchpoint): New. (update_watchpoint): Don't reparse the watchpoint's condition unless necessary. (WP_IGNORE): New. (watchpoint_check): Use it. (bpstat_check_watchpoint): Handle it. (bpstat_check_breakpoint_conditions): Evaluate watchpoint local conditions in a frame where it makes sense. (watch_command_1): Store the innermost block of the condition expression. (delete_breakpoint): Delete the watchpoint condition expression. * breakpoint.h (struct bp_location) : Update comment. (struct breakpoint): New fields `cond_exp' and `cond_exp_valid_block'. gdb/testsuite/ * gdb.base/watch-cond.c, gdb.base/watch-cond.exp: New. --- gdb/breakpoint.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'gdb/breakpoint.h') diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 6b373a3..73e2223 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -240,11 +240,13 @@ struct bp_location than reference counting. */ struct breakpoint *owner; - /* Conditional. Break only if this expression's value is nonzero. - Unlike string form of condition, which is associated with breakpoint, - this is associated with location, since if breakpoint has several - locations, the evaluation of expression can be different for - different locations. */ + /* Conditional. Break only if this expression's value is nonzero. + Unlike string form of condition, which is associated with + breakpoint, this is associated with location, since if breakpoint + has several locations, the evaluation of expression can be + different for different locations. Only valid for real + breakpoints; a watchpoint's conditional expression is stored in + the owner breakpoint object. */ struct expression *cond; /* This location's address is in an unloaded solib, and so this @@ -439,6 +441,11 @@ struct breakpoint /* The largest block within which it is valid, or NULL if it is valid anywhere (e.g. consists just of global symbols). */ struct block *exp_valid_block; + /* The conditional expression if any. NULL if not a watchpoint. */ + struct expression *cond_exp; + /* The largest block within which it is valid, or NULL if it is + valid anywhere (e.g. consists just of global symbols). */ + struct block *cond_exp_valid_block; /* Value of the watchpoint the last time we checked it, or NULL when we do not know the value yet or the value was not readable. VAL is never lazy. */ -- cgit v1.1