From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110347 invoked by alias); 7 May 2019 13:09:35 -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 110319 invoked by uid 89); 7 May 2019 13:09:35 -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.1 spammy=stale, HX-Languages-Length:671 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, 07 May 2019 13:09:34 +0000 Received: from [132.207.241.227] (Sansfil-Securise-Etudiants-Lassonde-241-227.polymtl.ca [132.207.241.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id CB1F61E0A9; Tue, 7 May 2019 09:09:30 -0400 (EDT) Subject: Re: [RFC 8/8] mi/python: Allow redefinition of python MI commands To: Jan Vrany , Tom Tromey Cc: gdb-patches References: <20190418152337.6376-1-jan.vrany@fit.cvut.cz> <20190418152337.6376-9-jan.vrany@fit.cvut.cz> <87h8al7tke.fsf@tromey.com> <87woj3mfbs.fsf@tromey.com> <31326cf9e4f843bef7141860306b20ee016b06bf.camel@fit.cvut.cz> From: Simon Marchi Message-ID: Date: Tue, 07 May 2019 13:09:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <31326cf9e4f843bef7141860306b20ee016b06bf.camel@fit.cvut.cz> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-05/txt/msg00185.txt.bz2 On 2019-05-07 7:25 a.m., Jan Vrany wrote: > I see. I just added a test for this case into "almost finished" > v2 of the patch series. There, this problem is kind of avoided by > making sure that in mi_command_py::invoke anything from "this" > mi_command_py object is not accessed AFTER calling the python code. > > However I agree that using shared_ptr is more robust solution. If we know that we don't access that pointer after it is possibly stale, and we document that fact properly, I think we can keep what you had initially. Using shared_ptr has a cost, and it's not really essential here. Simon