From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6342 invoked by alias); 10 Oct 2011 09:34:23 -0000 Received: (qmail 5760 invoked by uid 22791); 10 Oct 2011 09:34:22 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS 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; Mon, 10 Oct 2011 09:34:04 +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.14.4/8.14.4) with ESMTP id p9A9Y49n017792 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 10 Oct 2011 05:34:04 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p9A9Y3ss012650; Mon, 10 Oct 2011 05:34:03 -0400 From: Phil Muldoon To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [python] [patch] PR python/12656 (API for special blocks) References: Reply-to: pmuldoon@redhat.com X-URL: http://www.redhat.com Date: Mon, 10 Oct 2011 09:34:00 -0000 In-Reply-To: (Tom Tromey's message of "Fri, 07 Oct 2011 14:41:24 -0600") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-10/txt/msg00256.txt.bz2 Tom Tromey writes: >>>>>> "Phil" == Phil Muldoon writes: > Phil> +@defun Block.is_global () > Phil> +@defun Block.is_static () > > Why are these methods rather than attributes? Because is_valid is a method in py-block.c, and I decided to continue the is_* APIs to be methods. It confuses my *why* is_valid is a method over an attribute, too. I guess we missed this when we ported it over from archer (several other classes, too). I thought about changing is_valid, but this would be an API break. > Phil> - struct blpy_block_object *source; > Phil> + const struct blpy_block_object *source; > > Why make this one const? > It seems wrong given that we have to decref it when the iterator is > destroyed. Gratuitous on my part, apologies. > Phil> + Py_INCREF (Py_None); > Phil> + return Py_None; > > I think it is more normal to use Py_RETURN_NONE here. Thanks. > Phil> gdb_test "python print block_iter.is_valid()" "False" \ > Phil> "Check block validity" > Phil> + > > Gratuitous newline addition. > > Phil> -extern struct value *value_of_variable (struct symbol *var, struct block *b); > Phil> +extern struct value *value_of_variable (struct symbol *var, const struct block *b); > > This should probably wrap after the ",". Thanks. I've modified the patch accordingly, but as these are trivial changes I won't resubmit it until we reach a conclusion on the is_* question (and we need a doc review, anyway). Cheers, Phil