From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6964 invoked by alias); 7 Apr 2010 21:09:49 -0000 Received: (qmail 6942 invoked by uid 22791); 7 Apr 2010 21:09:48 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=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, 07 Apr 2010 21:09:44 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o37L9HjU022315 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 7 Apr 2010 17:09:18 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o37L9G7D030812; Wed, 7 Apr 2010 17:09:17 -0400 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 o37L9FM2006225; Wed, 7 Apr 2010 17:09:16 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 7C852379854; Wed, 7 Apr 2010 15:09:15 -0600 (MDT) From: Tom Tromey To: Phil Muldoon Cc: Joel Brobecker , gdb-patches ml , Eli Zaretskii Subject: Re: [patch][python] Add breakpoint support. References: <4BB0B063.6000600@redhat.com> <20100405162648.GD19194@adacore.com> <4BBB3AF6.8050407@redhat.com> Reply-To: tromey@redhat.com Date: Wed, 07 Apr 2010 21:09:00 -0000 In-Reply-To: <4BBB3AF6.8050407@redhat.com> (Phil Muldoon's message of "Tue, 06 Apr 2010 14:45:26 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-04/txt/msg00163.txt.bz2 >>>>> "Phil" == Phil Muldoon writes: Joel> This is definitely the standard, currently. Is that normal? Phil> In the archer repository some are and some aren't (for whatever Phil> reason). Yeah, we probably just missed them. Joel> Personally (and I litterally mean it, it's a personal preference), Joel> I'd rather we did not use macros, but a real function... Being a static Joel> function, I'm sure the compiler will be capable of performing whatever Joel> is best for performance (and that way, we can avoid the parens around Joel> "Num", and the "do/while(0)" dance in the macro that follows). Phil> The use of macros to check consistency of various GDB objects in the Phil> Python API seems pretty consistent with the code that is already in Phil> FSF CVS, and the code that is still in the Archer GIT repository . As Phil> a lot of this code is an effort from several different people over Phil> several periods of time, I cannot answer why this trend became the Phil> default. Things like GDB_PY_HANDLE_EXCEPTION have a "return" built in, which is why they must be macros. In this code I think it would be ok to replace BPPY_VALID_P with an appropriately-named static function. However, BPPY_REQUIRE_VALID and BPPY_SET_REQUIRE_VALID still have to be macros. (Well... you could make them functions and do an extra check in the caller, but as you say this style is already prevalent in the python code.) Tom