From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9227 invoked by alias); 4 Mar 2010 16:12:25 -0000 Received: (qmail 9199 invoked by uid 22791); 4 Mar 2010 16:12:24 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Mar 2010 16:12:21 +0000 Received: (qmail 31200 invoked from network); 4 Mar 2010 16:12:19 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 4 Mar 2010 16:12:19 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: Somewhat sanitize watchpoints with conditions on local expressions Date: Thu, 04 Mar 2010 16:12:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-19-generic; KDE/4.3.2; x86_64; ; ) Cc: Joel Brobecker References: <201003040350.34417.pedro@codesourcery.com> <20100304055926.GI2832@adacore.com> <201003041600.08015.pedro@codesourcery.com> In-Reply-To: <201003041600.08015.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201003041612.17294.pedro@codesourcery.com> X-IsSubscribed: yes 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/msg00185.txt.bz2 On Thursday 04 March 2010 16:00:07, Pedro Alves wrote: > > That, or maybe just disable the watchpoint and keep going? > > It's unclear > > what the user intent is, but maybe he really meant for the watchpoint > > to be local to the scope where the condition applies? One extra comment. I though of making the watchpoint trigger only exactly in the frame where the condition was set, so to conditionalize on a particular local instance, but I thought that if the user wants that behavior, he can emulate it by: (gdb) p &local (gdb) watch global if *$ > 10. But there's no way to emulate what the patch allows, and it seemed intuitive, so went with it, and so the user can have it both ways. -- Pedro Alves