From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 6CA9D3858C2D for ; Mon, 13 Nov 2023 16:47:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6CA9D3858C2D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6CA9D3858C2D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699894036; cv=none; b=HP47MkUlKZXdYODBs1AOPvLcs76m86lkuknpNNCbyZ2mIUFhPl6gWEMmKZbumjuhlq8n3gtoiRx6xyFoX5HjLhdcm4UGcGH+JrJFh1DmeQmUx5lfaEkQJLNGyALGUqW6FUDP5DAPcV19sUEaeP/WWs12T6VFI71NguL/1O3qbgc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699894036; c=relaxed/simple; bh=v9/lTZxND1FAGl1dPTyuYflco4yzCWvKKDgGQLVMIkU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=CcOfPZgi2m6eTGaA0cj8STpLZ5m/3dTz9IHByu+XCg7AFz2MMao4jnVFHWVBiOkmUgwvT9ntPd3ttZ3ayICgYesjIsSD1WJM3ZKsWYQavV3mAQQADwHs4qlHusOYsG9mGoAc9cWODN5SQI4Sk4KG9xegdmJJLrITKRh19vHWq+U= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 3ADGl7UM005378 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Nov 2023 11:47:12 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 3ADGl7UM005378 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1699894032; bh=7M8KHYGIKU39RwMkuYy02fSpMbuBxAkgma44iw05L0M=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ZXrzmKRAVX1r3c74h5V0fo+D8SVM0cc4wft0A6V7oeOanixjaY8IpHD0tZn2jnJjq iPM+Vrj9GZEqegymoVUHbEaZbs+c77sTy6KRERkKio6eTOVhmhw+Yo0lZqB/RW8Bmy 6P+qC3tBhtiJMNIgX+zjyrdJRBOUbkFfl+niPjKU= Received: from [172.25.82.120] (unknown [12.186.190.2]) (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 643F61E091; Mon, 13 Nov 2023 11:47:07 -0500 (EST) Message-ID: <57e29f9d-0b04-47da-b212-014189ac641e@polymtl.ca> Date: Mon, 13 Nov 2023 11:47:06 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 05/24] gdb: change regcache interface to use array_view Content-Language: fr To: Andrew Burgess , gdb-patches@sourceware.org Cc: Simon Marchi References: <20231108051222.1275306-1-simon.marchi@polymtl.ca> <20231108051222.1275306-6-simon.marchi@polymtl.ca> <878r71sr9r.fsf@redhat.com> <875y25sqgl.fsf@redhat.com> From: Simon Marchi In-Reply-To: <875y25sqgl.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 13 Nov 2023 16:47:07 +0000 X-Spam-Status: No, score=-3038.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 11/13/23 09:00, Andrew Burgess wrote: >>> diff --git a/gdbsupport/common-regcache.h b/gdbsupport/common-regcache.h >>> index 6d98ca8c92ed..75d209f7cbc0 100644 >>> --- a/gdbsupport/common-regcache.h >>> +++ b/gdbsupport/common-regcache.h >>> @@ -78,11 +78,44 @@ struct reg_buffer_common >>> buffer. */ >>> virtual register_status get_register_status (int regnum) const = 0; >>> >>> - /* Supply register REGNUM, whose contents are stored in BUF, to REGCACHE. */ >>> - virtual void raw_supply (int regnum, const void *buf) = 0; >>> + /* Supply register REGNUM, whose contents are stored in SRC, to this register >>> + buffer. */ >>> + virtual void raw_supply (int regnum, gdb::array_view src, >>> + float) = 0; >> >> The addition of the 'float' argument is pretty unexpected here. It's >> not mentioned in the commit message or the function comment, nor is it >> actually used in any of the function implementations as far as I can >> tell. I'm assuming this is resolving some C++ overload problem. >> >> Sorry if I've missed something ... I've only looked at the diff so far. >> I thought I'd reach out before I start playing with the code trying to >> figure out what's going on. > > As an initial experiment, I tried removing the float parameter after > applying every patch up to and including this one, and GDB still rebuilt > fine. > > Then I applied every patch in the series, and removed the float > parameter, and again GDB built fine. > > Maybe I'm missing something though... > > Thanks, > Andrew Haha, good catch, I added them during development as a temporary thing, to make sure I inspected all call sites, but of course I totally forgot to remove them. I added them to differentiate the calls to the raw pointer and array_view overloads of the functions, I don't recall my logic exactly. I remember I was worried about cases like these: gdb_byte buf[SOME_ARCH_MAX_REG_SIZE]; cooked_read (regnum, buf); We want this to pick up the raw pointer overload, because the size of register regnum is possibly smaller than SOME_ARCH_MAX_REG_SIZE. When I remove the dummy float parameters, clangd tells me that these cooked_read calls still pick up the raw pointer overload, so it seems ok. But I'll see in testing. For now I did the changes locally, I wull send a v2 once I fix the regressions identified by Luis. Thanks, Simon