From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by sourceware.org (Postfix) with ESMTPS id CB806385040C for ; Mon, 12 Jul 2021 13:14:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CB806385040C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 53193825E6; Mon, 12 Jul 2021 13:13:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GNkjd35cSz3jMN; Mon, 12 Jul 2021 13:13:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (d-24-233-223-154.va.cpe.atlanticbb.net [24.233.223.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id DCF69E533; Mon, 12 Jul 2021 13:13:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) To: Pedro Alves , gdb-patches@sourceware.org References: <20210528202614.2081-1-jhb@FreeBSD.org> <20210528202614.2081-2-jhb@FreeBSD.org> <983fca5b-e719-f2df-21bb-83c19c07581d@palves.net> From: John Baldwin Subject: Re: [PATCH 1/5] Add regcache_map_supplies helper routine. Message-ID: Date: Mon, 12 Jul 2021 09:13:37 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <983fca5b-e719-f2df-21bb-83c19c07581d@palves.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jul 2021 13:14:30 -0000 On 7/10/21 12:25 PM, Pedro Alves wrote: > On 2021-05-28 9:26 p.m., John Baldwin wrote: > >> diff --git a/gdb/regcache.h b/gdb/regcache.h >> index ee254f381f4..a1f63d40253 100644 >> --- a/gdb/regcache.h >> +++ b/gdb/regcache.h >> @@ -150,6 +150,13 @@ extern void regcache_collect_regset (const struct regset *regset, >> int regnum, void *buf, size_t size); >> >> >> +/* Return true if a set of registers (whose layout is described by >> + MAP) contains the value of the register numbered REGNUM. */ > > I assume SIZE is the register's size? From the description of regcache_map, some of the > map entries have sizes smaller than the corresponding register's size. How do > they interact? IOW, please document SIZE. :-) Ah, will do. In this case SIZE is the size of the entire register set, the same as the size passed to regcache::collect_regset and regcache::supply_regset that this is intended to be paired with, e.g. for a native target fetch_registers: struct reg regs; if (regnum == -1 || regcache_map_supplies (map, regnum, gdbarch, sizeof (regs)) { /* populate 'regs' */ regcache->supply_regset (regset, regnum, ®s, sizeof (regs)); } I've modified the comment to: /* Return true if a set of registers contains the value of the register numbered REGNUM. The size of the set of registers is given in SIZE, and the layout of the set of registers is described by MAP. */ -- John Baldwin