From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 3DE793858C56 for ; Thu, 21 Dec 2023 21:23:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3DE793858C56 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3DE793858C56 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703193784; cv=none; b=Dz0XWKAqomwq9+AvslrjuTb3NjFvEiJPqE9JxDtltp0q6TyScbkq/PhcCvQLZc0f362ildMA0hm9asmt0N/grFl7gNF1/5zlAPyLY9PLaeRGkN+tMuWkCC+SG7NqCscePg5R7DvN8m7A5Y+OcvgGy+e44mxRy4/sxMkQ4AVdegc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703193784; c=relaxed/simple; bh=dXh3k+AEUCaZ/mC6twS3gXDBL3jfaPBkp/drNl5IIxU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=bQWni/tBWS14MacJXi50JWe8e5Dlp6EjVIHQpzDdE9F1cHZpXcfdAsFRjIlRBhCtn4sEFiD5shVhV1aj53Z1Z8triTv3lia9tHgchPL+Xri0Dg85XN6mb6HnA8yWiXIw805rTQMVFp03+1P9zLS5ugat0nS9krGTDJDbdLzBFL4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1703193782; bh=dXh3k+AEUCaZ/mC6twS3gXDBL3jfaPBkp/drNl5IIxU=; h=Date:Subject:To:References:From:In-Reply-To:From; b=UbfDFwe+treuToSbSXwqRW1RkD1EUeg0tXKsCg7xQKzXe7MgMB2jWqoEKJEC/jP6n QeHSu8I4SoLPtGv3OixdALdgcjf4qRrP7rVB5ZydeL7BOirqxewPCqRvbCHP1H+Bg1 04m4pgsFnFUJx8EFgtj+PJjtCsTkGsWxjq5Bdfxc= Received: from [172.16.0.192] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id CD19B1E0AC; Thu, 21 Dec 2023 16:23:02 -0500 (EST) Message-ID: <61e50fae-7946-4859-9b37-f4ed580a5aa4@simark.ca> Date: Thu, 21 Dec 2023 16:23:02 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 12/26] gdbserver: convert supply_regblock to regcache::supply_regblock Content-Language: fr To: Tankut Baris Aktemur , gdb-patches@sourceware.org References: <1281d173376d23b5da5e09529aafeb6618672fd6.1677582744.git.tankut.baris.aktemur@intel.com> From: Simon Marchi In-Reply-To: <1281d173376d23b5da5e09529aafeb6618672fd6.1677582744.git.tankut.baris.aktemur@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2/28/23 06:28, Tankut Baris Aktemur via Gdb-patches wrote: > Convert the supply_regblock function into a method of the regcache > struct. Also do some minor code modernization. > --- > gdbserver/regcache.cc | 32 ++++++++------------------------ > gdbserver/regcache.h | 7 +++++-- > gdbserver/tracepoint.cc | 8 ++++---- > 3 files changed, 17 insertions(+), 30 deletions(-) > > diff --git a/gdbserver/regcache.cc b/gdbserver/regcache.cc > index 156fda7068d..31f1e7bb3dc 100644 > --- a/gdbserver/regcache.cc > +++ b/gdbserver/regcache.cc > @@ -376,39 +376,23 @@ supply_register_by_name_zeroed (struct regcache *regcache, > > #endif > > -/* Supply the whole register set whose contents are stored in BUF, to > - REGCACHE. If BUF is NULL, all the registers' values are recorded > - as unavailable. */ > - > void > -supply_regblock (struct regcache *regcache, const void *buf) > +regcache::supply_regblock (const void *buf) Add `/* See regcache.h. */`. Can you investigate if the buf == nullptr case is really needed? It seems to me like the only times we call supply_regblock with nullptr is just after creating a fresh regcache. Since the regcache is created with all registers in the REG_UNAVAILABLE state, perhaps those spots can just omit calling supply_regblock, and supply_regblock can be simplified? Simon