From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20233 invoked by alias); 9 Sep 2018 07:14:56 -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 20223 invoked by uid 89); 9 Sep 2018 07:14:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 09 Sep 2018 07:14:54 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w897Elig023058 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 9 Sep 2018 03:14:52 -0400 Received: by simark.ca (Postfix, from userid 112) id 4B5B31E76F; Sun, 9 Sep 2018 03:14:47 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id DFACD1E16B; Sun, 9 Sep 2018 03:14:44 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 09 Sep 2018 07:14:00 -0000 From: Simon Marchi To: Tom Tromey Cc: Simon Marchi , gdb-patches@sourceware.org Subject: Re: [PATCH] python: Make two functions return gdbpy_ref<> In-Reply-To: <874lez5qhb.fsf@tromey.com> References: <1536448885-6222-1-git-send-email-simon.marchi@ericsson.com> <874lez5qhb.fsf@tromey.com> Message-ID: <8b5ce61f643215bc9bb8e1aa1b02b205@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00224.txt.bz2 On 2018-09-09 03:55, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> I noticed that we release a gdbpy_ref in pretty_print_one_value > only to > Simon> create it again later. This patch fills the gap by returning a > Simon> gdbpy_ref all the way. > > Simon> gdb/ChangeLog: > > Simon> * python/py-prettyprint.c (pretty_print_one_value): Return > Simon> gdbpy_ref<>. > Simon> (print_string_repr): Adjust. > Simon> (apply_varobj_pretty_printer): Return gdbpy_ref<>. > Simon> * python/python-internal.h (apply_varobj_pretty_printer): > Return > Simon> gdbpy_ref<>. > Simon> * varobj.c (varobj_value_get_print_value): Adjust. > > Thanks, this seems like a good improvement to me. > I'm sure there are more of these lurking. Thanks, I pushed it. Simon