From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OoehCIKRBGV+xxYAWB0awg (envelope-from ) for ; Fri, 15 Sep 2023 13:16:50 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=nDBjAG7O; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 1AD161E0C3; Fri, 15 Sep 2023 13:16:50 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 0A5FE1E092 for ; Fri, 15 Sep 2023 13:16:48 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2214D3858C52 for ; Fri, 15 Sep 2023 17:16:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2214D3858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694798207; bh=HdGfyC5bMrmxD1AtvYhhMYecUul3mybNorzFqneLje8=; h=Date:To:Cc:Subject:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=nDBjAG7OWKyqofXtXfLYyxtWecSKJBJWwPKjt2VDlWJXnmYNhJPOoN7XMUxWOythO MK+ZEzFykNyM/y3go32/nMPP/qMl2DUFKIU9O+v6fn9GC9UcXFlJJcga0Vok/MFBjP vCCRLXg/Id0tV+UkDBKv0fl6KIHhozxpy6mrO8to= Received: from lndn.lancelotsix.com (lndn.lancelotsix.com [51.195.220.111]) by sourceware.org (Postfix) with ESMTPS id 538C63858D35 for ; Fri, 15 Sep 2023 17:16:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 538C63858D35 Received: from octopus (cust120-dsl54.idnet.net [212.69.54.120]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id B539C80910; Fri, 15 Sep 2023 17:16:19 +0000 (UTC) Date: Fri, 15 Sep 2023 18:16:11 +0100 To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v3 3/3] gdb/amdgpu: add precise-memory support Message-ID: <20230915171601.cpwzr7yxsfqykdlt@octopus> References: <20230915145249.22318-1-simon.marchi@efficios.com> <20230915145249.22318-3-simon.marchi@efficios.com> <20230915160454.qoc3pjpl5fyxgz45@octopus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (lndn.lancelotsix.com [0.0.0.0]); Fri, 15 Sep 2023 17:16:19 +0000 (UTC) X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Lancelot SIX via Gdb-patches Reply-To: Lancelot SIX Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" > > Moving the initialization in the ctor's body would solve the issue > > > > explicit amd_dbgapi_inferior_info (inferior *inf, > > bool precise_memory_requested = false) > > : inf {inf} > > { > > precise_memory.requested = precise_memory_requested; > > } > > > > The alternative would be to name > > amd_dbgapi_inferior_info::precise_memory's type and give it a ctor. > > In this case I would just do: > > diff --git a/gdb/amd-dbgapi-target.c b/gdb/amd-dbgapi-target.c > index 507824decf8d..40baf156d83f 100644 > --- a/gdb/amd-dbgapi-target.c > +++ b/gdb/amd-dbgapi-target.c > @@ -119,8 +119,10 @@ struct amd_dbgapi_inferior_info > { > explicit amd_dbgapi_inferior_info (inferior *inf, > bool precise_memory_requested = false) > - : inf {inf}, precise_memory {precise_memory_requested} > - {} > + : inf (inf) > + { > + precise_memory.requested = precise_memory_requested; > + } That would work for me. Lancelot. > > /* Backlink to inferior. */ > inferior *inf; > > --- > > Or, we can just have two separate fields (precise_memory_requested and > precise_memory_enabled), they don't really need to be in a struct. > > Simon