From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125650 invoked by alias); 24 Jan 2017 20:21: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 125609 invoked by uid 89); 24 Jan 2017 20:21:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=tromey, Tromey, H*u:1.2.3, H*UA:1.2.3 X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 24 Jan 2017 20:21:50 +0000 Received: by simark.ca (Postfix, from userid 33) id 97B491E166; Tue, 24 Jan 2017 15:21:48 -0500 (EST) To: Tom Tromey Subject: Re: [RFA 3/5] Introduce gdbpy_subclass and use it to simplify some logic X-PHP-Originating-Script: 33:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 24 Jan 2017 20:21:00 -0000 From: Simon Marchi Cc: gdb-patches@sourceware.org In-Reply-To: <20170115134253.24018-4-tom@tromey.com> References: <20170115134253.24018-1-tom@tromey.com> <20170115134253.24018-4-tom@tromey.com> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.3 X-IsSubscribed: yes X-SW-Source: 2017-01/txt/msg00506.txt.bz2 On 2017-01-15 08:42, Tom Tromey wrote: > This introduces a new typed variant of gdbpy_ref, called > gdbpy_subclass. This is then used to simplify logic in various parts > of the Python layer; for example removing repeated error code or > removing gotos. > > 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).