From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28055 invoked by alias); 15 Dec 2010 20:57:36 -0000 Received: (qmail 28047 invoked by uid 22791); 15 Dec 2010 20:57:35 -0000 X-SWARE-Spam-Status: No, hits=-6.9 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; Wed, 15 Dec 2010 20:57:31 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oBFKvSe6016885 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 15 Dec 2010 15:57:28 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oBFKvRqN027220; Wed, 15 Dec 2010 15:57:27 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id oBFKvRZM027959; Wed, 15 Dec 2010 15:57:27 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id E553A379182; Wed, 15 Dec 2010 13:57:26 -0700 (MST) From: Tom Tromey To: Doug Evans Cc: pmuldoon@redhat.com, gdb-patches@sourceware.org Subject: Re: [patch] Add an evaluation function hook to Python breakpoints. References: Date: Wed, 15 Dec 2010 20:57:00 -0000 In-Reply-To: (Doug Evans's message of "Wed, 15 Dec 2010 08:21:08 -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 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-12/txt/msg00326.txt.bz2 >>>>> "Doug" =3D=3D Doug Evans writes: Tom> By "clean" I just mean that we want it not to have user-visible effects Tom> other than the effects we intend. =C2=A0Yes, we can do it using a pyth= on Tom> convenience function -- but the convenience function's name is visible Tom> and in a flat namespace. Doug> The reference to convenience functions was *not* a serious attempt at Doug> arguing against doing something. Doug> It was just an off the cuff comment regarding hacky solutions. Sorry, I did not mean to imply that you meant this. I was just listing our criteria for a solution. Tom> Having two methods seems worse to me. =C2=A0It is more complicated wit= hout Tom> any added benefits. Doug> One thought I had was that maybe one might have a situation where it'd Doug> be useful to run all the collect methods first, and then run all the Doug> stop_p methods. Could you give an example? Doug> Plus I still like the API design of keeping data collection separate Doug> from stop/don't-stop. Can you say why? I like the other way because it is simpler. Also, I can't think of a reason I would ever need two methods. Doug> But don't let my $0.02 cents get in the way ... btw ... Doug> If you *really* want to go this route, go for it. Ok. We can always add a second method if we find a need. Doug> Btw, if some mutex-checker or whatever detected a condition that it Doug> wanted to report to the user, IWBN to be able to throw an error that Doug> some higher level construct could recognize and deal with. Doug> Is a simple boolean result from stop_p (I'm only calling that for Doug> clarity's sake) going to be sufficient? I don't understand. What higher level are you thinking of? Could you give an example of when we would want to throw an exception and what that would mean? Tom