From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7235 invoked by alias); 21 Aug 2013 14:56:53 -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 7221 invoked by uid 89); 21 Aug 2013 14:56:52 -0000 X-Spam-SWARE-Status: No, score=-7.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 21 Aug 2013 14:56:52 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7LEuo0l013352 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 21 Aug 2013 10:56:51 -0400 Received: from barimba (ovpn-113-142.phx2.redhat.com [10.3.113.142]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r7LEun6I001247 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 21 Aug 2013 10:56:49 -0400 From: Tom Tromey To: Phil Muldoon Cc: "gdb-patches\@sourceware.org" Subject: Re: [patch] [python] Fix Python 3 build and testsuite issues References: <521230C8.2040803@redhat.com> <878uzxlkl1.fsf@fleche.redhat.com> <52124B8D.6010609@redhat.com> <87ppt9jzrl.fsf@fleche.redhat.com> <5213C6BA.7030703@redhat.com> <87d2p8gmlo.fsf@fleche.redhat.com> <5213D26D.4070003@redhat.com> Date: Wed, 21 Aug 2013 14:56:00 -0000 In-Reply-To: <5213D26D.4070003@redhat.com> (Phil Muldoon's message of "Tue, 20 Aug 2013 21:32:45 +0100") Message-ID: <87a9kbf5xq.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-08/txt/msg00583.txt.bz2 >>>>> "Phil" == Phil Muldoon writes: Phil> For the hasattr point, I believe the equivalent check is the same in Phil> this version, as the incompatible Python 3 frame filters code. But I Phil> use several methods of gdb.Symbol so which one would we use? Remember Phil> this is not the Symbol/Value like interface that frame_args, and Phil> frame_locals returns, but the actual return of the symbol() function Phil> from that interface. At this point in the code we have already called Phil> that symbol() API and have the object it returned. We could pick any unique-to-Symbol method as a sentinel. Say, the first one called in this method. Phil> See SymValueWrapper class in FrameDecorator.py. This object interface Phil> specifies that it must return either a string, or a gdb.Symbol. I Phil> suppose you could return a Symbol like object, but you would have to Phil> implement pretty much all of the gdb.Symbol methods. This would not Phil> make a great deal of sense. Instead we should make gdb.Symbol Phil> inheritable, so the user can sub-class. This new child class of Phil> gdb.Symbol would still work with the above code as the code makes no Phil> assumptions of the class other than it has the available methods. I think subclassing Symbol is problematic. For example I think it means it is hard to make a purely synthetic one. What would the native state look like? Where would it come from? It seems better to go with Python's duck-typing approach instead. Tom