From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4164 invoked by alias); 8 Mar 2010 06:34:08 -0000 Received: (qmail 4156 invoked by uid 22791); 8 Mar 2010 06:34:08 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 08 Mar 2010 06:34:04 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id E9A712BAB4E; Mon, 8 Mar 2010 01:34:02 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id SOh5YEbQQrmh; Mon, 8 Mar 2010 01:34:02 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 7164F2BAB4C; Mon, 8 Mar 2010 01:34:02 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 3FB11F5894; Mon, 8 Mar 2010 10:33:48 +0400 (RET) Date: Mon, 08 Mar 2010 06:34:00 -0000 From: Joel Brobecker To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: Somewhat sanitize watchpoints with conditions on local expressions Message-ID: <20100308063348.GD3081@adacore.com> References: <201003040350.34417.pedro@codesourcery.com> <201003041600.08015.pedro@codesourcery.com> <201003041612.17294.pedro@codesourcery.com> <201003041618.59734.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201003041618.59734.pedro@codesourcery.com> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00295.txt.bz2 > 2010-03-04 Pedro Alves > > 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 field `cond_exp_valid_block'. > > gdb/testsuite/ > * gdb.base/watch-cond.c, gdb.base/watch-cond.exp: New. FWIW, this looks fine to me. And after discussion, I agree it seems much better to always stop rather than disable the watchpoint when the condition can no longer be evaluated in the current scope. -- Joel