From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94924 invoked by alias); 16 Sep 2018 01:28:32 -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 94913 invoked by uid 89); 16 Sep 2018 01:28:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=gdbpy_objfiles, CXX, Hx-languages-length:1553, cxx 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; Sun, 16 Sep 2018 01:28:30 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 12EC01E186; Sat, 15 Sep 2018 21:28:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=simark.ca; s=mail; t=1537061308; bh=YWBaoNL9lswfy0Xm1L6wF/XNizIBtDxY8SavwH57DBI=; h=Subject:To:References:From:Date:In-Reply-To:From; b=ZLfr/N03zo88unXqXE4EWNp/0V6NGLkCGmO5mdrNXjz/dD0ho3ymEmauz+hjUREqv uas8ZPcTaIDu2sqymHj+1xM8qkx3+yBYhHipgP1mA+4buMi2XQICNen753rs23sxyT Ag6exgrcRqREsgPFBCtUzDT921d0H/cExEv9rA3Y= Subject: Re: [PATCH 2/4] Change objfile_to_objfile_object to return a new reference To: Tom Tromey , gdb-patches@sourceware.org References: <20180913053007.11780-1-tom@tromey.com> <20180913053007.11780-3-tom@tromey.com> From: Simon Marchi Message-ID: Date: Sun, 16 Sep 2018 01:28:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180913053007.11780-3-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-09/txt/msg00513.txt.bz2 On 2018-09-13 1:30 a.m., Tom Tromey wrote: > This changes objfile_to_objfile_object to return a new references and > fixes up all the uses. > > 2018-09-12 Tom Tromey > > * python/python-internal.h (objfile_to_objfile_object): Change > return type. > * python/py-newobjfileevent.c (create_new_objfile_event_object): > Update. > * python/py-xmethods.c (gdbpy_get_matching_xmethod_workers): > Update. > * python/python.c (gdbpy_get_current_objfile): Update. > (gdbpy_objfiles): Update. > * python/py-objfile.c (objfpy_get_owner, gdbpy_lookup_objfile): > Update. > (objfile_to_objfile_object): Return a new reference. > * python/py-symtab.c (stpy_get_objfile): Update. > * python/py-prettyprint.c (find_pretty_printer_from_objfiles): > Update. I'm also getting some failures with this patch; CXX python/python.o /home/simark/src/binutils-gdb/gdb/python/python.c:1432:12: error: assigning to 'PyObject *' (aka '_object *') from incompatible type 'gdbpy_ref<>' (aka 'gdb::ref_ptr<_object, gdbpy_ref_policy<_object> >') result = objfile_to_objfile_object (gdbpy_current_objfile); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/simark/src/binutils-gdb/gdb/python/python.c:1451:17: error: no viable conversion from 'gdbpy_ref<>' (aka 'gdb::ref_ptr<_object, gdbpy_ref_policy<_object> >') to 'PyObject *' (aka '_object *') PyObject *item = objfile_to_objfile_object (objf); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The rest of the changes looks good to me. Simon