From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 97747 invoked by alias); 10 Jul 2019 16:59:17 -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 97738 invoked by uid 89); 10 Jul 2019 16:59:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,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, 10 Jul 2019 16:59:16 +0000 Received: from [172.16.0.120] (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id B98B81E05C; Wed, 10 Jul 2019 12:59:14 -0400 (EDT) Subject: Re: [PATCH 1/9] Change remote-sim.c to use type-safe registry To: Tom Tromey , gdb-patches@sourceware.org References: <20190710153947.25721-1-tromey@adacore.com> <20190710153947.25721-2-tromey@adacore.com> From: Simon Marchi Message-ID: <1c14cf2e-6cef-3f3a-39dc-2cc3cae23e88@simark.ca> Date: Wed, 10 Jul 2019 16:59:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190710153947.25721-2-tromey@adacore.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-07/txt/msg00267.txt.bz2 Hi Tom, Just one nit: > diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c > index a22a59ed399..9030ead562d 100644 > --- a/gdb/remote-sim.c > +++ b/gdb/remote-sim.c > @@ -132,15 +132,15 @@ struct gdbsim_target final > > static struct gdbsim_target gdbsim_ops; > > -static const struct inferior_data *sim_inferior_data_key; > - > /* Simulator-specific, per-inferior state. */ > struct sim_inferior_data { > + ~sim_inferior_data (); > + > /* Flag which indicates whether or not the program has been loaded. */ > - int program_loaded; > + int program_loaded = 0; > > /* Simulator descriptor for this inferior. */ > - SIM_DESC gdbsim_desc; > + SIM_DESC gdbsim_desc = nullptr; > > /* This is the ptid we use for this particular simulator instance. Its > value is somewhat arbitrary, as the simulator target don't have a > @@ -150,12 +150,14 @@ struct sim_inferior_data { > ptid_t remote_sim_ptid; It probably doesn't matter because it's reassigned after sim_inferior_data, is allocated, but this field should probably be initialized too, to be consistent with the other fields. ptid_t doesn't initialize its fields by default (to remain a POD), so its initial content would be some garbage. Otherwise, LGTM. Simon