From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29116 invoked by alias); 22 May 2018 17:31:05 -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 7404 invoked by uid 89); 22 May 2018 17:30:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 May 2018 17:30:47 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 458F1818BAFC; Tue, 22 May 2018 17:30:45 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id C662E1C66D; Tue, 22 May 2018 17:30:44 +0000 (UTC) Subject: Re: [PATCH 10/10] remote: one struct remote_state per struct remote_target To: Simon Marchi , gdb-patches@sourceware.org References: <20180516141830.16859-1-palves@redhat.com> <20180516141830.16859-11-palves@redhat.com> From: Pedro Alves Message-ID: Date: Tue, 22 May 2018 21:06:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-05/txt/msg00564.txt.bz2 On 05/22/2018 04:37 AM, Simon Marchi wrote: > I took a rather quick look, because a lot of the changes are mecanical, > once you have set the premises you pointed out in the commit message > (and I think they are fine). > > Two nits: > > Is there a reason not to make the remote_state object a simple field > of remote_target, does it have to be a pointer? You would have to > shuffle things around a little bit more, but it seems to work fine. Yeah, no reason other than struct remote_state not being complete yet when the field is defined in struct remote_target. I was thinking the moving would be done as follow up, to avoid even more churn mixed in with changes, very much like patch #4 started with a pointer and then patch #5 moved to objects. > >> @@ -6287,7 +6512,7 @@ remote_target::commit_resume () >> we end up with too many actions for a single packet vcont_builder >> flushes the current vCont packet to the remote side and starts a >> new one. */ >> - struct vcont_builder vcont_builder; >> + struct vcont_builder vcont_builder (this); >> vcont_builder.restart (); > > That's more a comment for the previous patch, but: I find it strange to > have to call restart just after building the object. Couldn't the > constructor leave it in a ready to use state? Yeah, I guess it could. I've made that change. I'll post it in response to the previous patch. Thanks, Pedro Alves