From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101774 invoked by alias); 9 Feb 2017 11:44:09 -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 101754 invoked by uid 89); 9 Feb 2017 11:44:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Introduce X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Feb 2017 11:44:07 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 190593A7696; Thu, 9 Feb 2017 11:44:07 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v19Bi56L011014; Thu, 9 Feb 2017 06:44:06 -0500 Subject: Re: [RFA 3/5] Introduce gdbpy_subclass and use it to simplify some logic To: Simon Marchi , Tom Tromey References: <20170115134253.24018-1-tom@tromey.com> <20170115134253.24018-4-tom@tromey.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <14228db3-a759-a117-e088-2542da718106@redhat.com> Date: Thu, 09 Feb 2017 11:44:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-02/txt/msg00214.txt.bz2 On 01/24/2017 08:21 PM, Simon Marchi wrote: >> I wouldn't mind a better than than "gdb_subclass". One idea was to >> use gdb_ref with a default template parameter, and then change the >> existing uses of "gdb_ref" to "gdb_ref<>". > > Do you mean gdbpy_ref and gdbpy_subclass? > > I don't really like gdbpy_subclass, I think there should be "ref" in the > name to be clear. So it could be gdbpy_subclass_ref. However, I find > gdbpy_subclass_ref a bit long. As you may have > seen in my version of the patch, I had decided to keep gdbpy_ref for > PyObjects and introduce typedef for other types (gdbpy_inf_ref). So I > could see one called gdbpy_bp_ref. > > Otherwise, I like gdbpy_ref<> and gdbpy_ref. > > The patch looked good to me otherwise (and confirmed that I still find > refcounting difficult). I agree. Simon's gdbpy_ref_base + typedef idea would work for me too. Thanks, Pedro Alves