From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33562 invoked by alias); 16 Sep 2018 02:00:01 -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 33528 invoked by uid 89); 16 Sep 2018 01:59:59 -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=Hx-languages-length:1800 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:59:58 +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 134D41E16B; Sat, 15 Sep 2018 21:59:56 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=simark.ca; s=mail; t=1537063197; bh=ANucNz5oZxUE0iCnY1YWkjQshO6qiyLxZwY4RM3jPNU=; h=Subject:From:To:References:Date:In-Reply-To:From; b=pnsMDGfOp7EO/sIP9BLsSuvEEqJylnOYZWYqfR/b/VpvqL0ZbxRp5QHV1pGJRtbUd Zgjjexv+sg2saqTX4MIDjWXJmCOs97rCaNxiM0ZVDJ7I2EFMWE4WpnMK7xMekbc8JJ blL11ZSQsrAju91vMGiSWF1m1/ZHMPM6Sr1RBI1c= Subject: Re: [PATCH 2/4] Change objfile_to_objfile_object to return a new reference From: Simon Marchi To: Tom Tromey , gdb-patches@sourceware.org References: <20180913053007.11780-1-tom@tromey.com> <20180913053007.11780-3-tom@tromey.com> Message-ID: <63ef1251-8232-508f-8f3f-1cbd16f621e4@simark.ca> Date: Sun, 16 Sep 2018 02:00: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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-09/txt/msg00515.txt.bz2 On 2018-09-15 9:28 p.m., Simon Marchi wrote: > 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); > ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Forget about this failure. I had trouble applying the patches (finding the right base commit) and managed to get rid of the changes in that file when dealing with the conflicts. Everything looks fine here. Simon