From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126487 invoked by alias); 7 May 2019 13:19:28 -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 126416 invoked by uid 89); 7 May 2019 13:19:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: relay.fit.cvut.cz Received: from relay.fit.cvut.cz (HELO relay.fit.cvut.cz) (147.32.232.237) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 May 2019 13:19:25 +0000 Received: from imap.fit.cvut.cz (imap.fit.cvut.cz [147.32.232.238]) by relay.fit.cvut.cz (8.15.2/8.15.2) with ESMTPS id x47DJJX3014120 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 May 2019 15:19:21 +0200 (CEST) (envelope-from jan.vrany@fit.cvut.cz) Received: from sao (02791bac.bb.sky.com [2.121.27.172] (may be forged)) (authenticated bits=0 as user vranyj1) by imap.fit.cvut.cz (8.15.2/8.15.2) with ESMTPSA id x47DJISI063099 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 7 May 2019 15:19:19 +0200 (CEST) (envelope-from jan.vrany@fit.cvut.cz) Message-ID: Subject: Re: [RFC 8/8] mi/python: Allow redefinition of python MI commands From: Jan Vrany To: Simon Marchi , Tom Tromey Cc: gdb-patches Date: Tue, 07 May 2019 13:19:00 -0000 In-Reply-To: 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> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-05/txt/msg00187.txt.bz2 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! Jan > Simon