From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23336 invoked by alias); 8 May 2019 00:10:46 -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 23327 invoked by uid 89); 8 May 2019 00:10:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy= 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; Wed, 08 May 2019 00:10:45 +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 A31181E636; Tue, 7 May 2019 20:10:40 -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: <6c3908c7-f4a1-3748-594d-576c68fc42b0@simark.ca> Date: Wed, 08 May 2019 00:10: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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-05/txt/msg00192.txt.bz2 On 2019-05-07 9:19 a.m., Jan Vrany wrote: > On Tue, 2019-05-07 at 09:09 -0400, Simon Marchi wrote: >> 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. >> > > All right. Thanks! Well that's my opinion, let's see what Tom thinks about it. Simon