From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31613 invoked by alias); 27 Jan 2011 17:36:47 -0000 Received: (qmail 31343 invoked by uid 22791); 27 Jan 2011 17:36:45 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 27 Jan 2011 17:36:41 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0RHaS2N016973 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 27 Jan 2011 12:36:28 -0500 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p0RHaQXM026505; Thu, 27 Jan 2011 12:36:26 -0500 From: Phil Muldoon To: Doug Evans Cc: Tom Tromey , pedro@codesourcery.com, eliz@gnu.org, gdb-patches@sourceware.org Subject: Re: [patch] Add an evaluation function hook to Python breakpoints. References: Reply-to: pmuldoon@redhat.com X-URL: http://www.redhat.com Date: Thu, 27 Jan 2011 21:40:00 -0000 In-Reply-To: (Doug Evans's message of "Thu, 27 Jan 2011 09:18:38 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: 2011-01/txt/msg00520.txt.bz2 Doug Evans writes: > On Thu, Jan 27, 2011 at 1:41 AM, Phil Muldoon wrote: > > > Since we're now overloading the "condition" member, what happens if= the > > user sets a condition on the breakpoint? > > > > I think we may need an additional check here, to see if the "condit= ion" > > member is a callable object. >=20=20=20=20 > I cannot find a way to test if an attribute is callable or > not. There is: =C2=A0PyCallable_Check but that only refers to the obj= ect > itself. =C2=A0I think there is only a check to see if the attribute e= xists > (which we do), but as you correctly point out, as we are overloading > "condition" that will always return True. =C2=A0For now, as we are wa= iting > for other bits of the breakpoint puzzle to fall in place, I've return= ed > the name to "eval". =C2=A0It is trivial to change it in the code and = tests at > a later date. > > Hi. =C2=A0I'd like to understand this better. > I'm not advocating any particular position, I just want to make sure we d= on't make a mistake - it is not trivial to change the published API (if it = were > we'd get rid of SENTINEL_FRAME 1/2 :-)). I totally agree, but this is still just work-in-progress. This only exists= in my archer branch. I apologies for waiting so long to reply, I thought I had already!=20 > > AIUI, the suggestion is to have "condition" be the cli breakpoint conditi= on and "eval" be another condition available in the python breakpoint API. = =C2=A0Am I > correct? > [Apologies, it's been awhile since I looked at this.] This was purely a collision on naming. There is the *attribute* "condition" which has been in the API from the very start. You could just set this (IE if foo =3D=3D 12) and it would be analogous to the user typing in a condition in the GDB CLI. It accepted a string, and it was purely a textual interface to the existing GDB CLI conditions framework.=20= =20=20 The new stuff was the Python written condition. This is where you could write your condition in Python by implementing a method called "condition". Tom noted that if you had an old type condition, the current code would try to execute it (so it was faulty), as the hasAttr function will report it exists. My note was that I could not determine if hasAttr was reporting the condition method, or the the condition attribute. So I renamed it back to something I used before. My trivial note text just indicated that we can call it what we like when we agree on the breakpoint work, it is a 5 minute task to do that. Cheers Phil