From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9099 invoked by alias); 14 Nov 2013 21:16:11 -0000 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 Received: (qmail 9046 invoked by uid 89); 14 Nov 2013 21:16:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_20,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Nov 2013 21:16:08 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAELFvPj001994 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 14 Nov 2013 16:15:58 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rAELFso0026565; Thu, 14 Nov 2013 16:15:55 -0500 Message-ID: <52853D8A.5070908@redhat.com> Date: Thu, 14 Nov 2013 21:21:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Tom Tromey CC: Doug Evans , gdb-patches@sourceware.org, pmuldoon@redhat.com, eliz@gnu.org Subject: Re: [PATCH, doc RFA] Allow CLI and Python conditions to be set on same breakpoint References: <87bo1mwvqg.fsf@fleche.redhat.com> In-Reply-To: <87bo1mwvqg.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-11/txt/msg00393.txt.bz2 On 11/14/2013 08:53 PM, Tom Tromey wrote: >>>>>> "Doug" == Doug Evans writes: > > Doug> +A breakpoint may have both a normal breakpoint condition > Doug> +(@pxref{Conditions, ,Break Conditions}) and a Python > Doug> +@code{gdb.Breakpoint.stop} condition. > Doug> +Both will be evaluated and if either return @code{True} then the > Doug> +inferior will be stopped, otherwise the inferior will continue. > > I'm not certain that these are the best semantics. > > A motivating case for the Python "stop" method was to be able to let > Python authors write new kinds of breakpoints. > > Say, for example, one wanted a breakpoint that triggered based on a > Python source file and line. One could implement this by putting a > breakpoint in the Python interpreter with a suitable "stop" method. > > In order for this to make sense, all the non-matching calls in the > interpreter must be discarded. That is, stop returns false. > > In this scenario, your proposed patch would go on to evaluate the > condition and perhaps break anyway. > But this violates the whole idea of > the new breakpoint. Here, the CLI condition would most usefully be an > additional condition -- not a parallel one. That does make sense. In that scenario, it then sounds like it's best to think of the "stop" method more like a ops->check_status implementation/extension, than a breakpoint condition. > This particular example would be better with some other additions to the > gdb breakpoint API; and maybe those would obviate the need for this dual > purposing. But since we don't have those additions, it remains unclear > to me that "|" is better than "&&" here. Yeah, it does sound like && is more useful. To get "|", the user can set another breakpoint at the same address/whatever with a cli condition. -- Pedro Alves