public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: John Baldwin <jhb@FreeBSD.org>, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/5] Add regcache_map_supplies helper routine.
Date: Mon, 12 Jul 2021 14:21:17 +0100	[thread overview]
Message-ID: <b4dcce04-b0a8-73cb-f468-fd3c357d6bbd@palves.net> (raw)
In-Reply-To: <b238ae99-43e6-d623-f262-a1a0a9452f8b@FreeBSD.org>

On 2021-07-12 2:13 p.m., John Baldwin wrote:
> 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, &regs, 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.  */
> 

Works for me, thanks!

  reply	other threads:[~2021-07-12 13:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-28 20:26 [PATCH 0/5] Add helper functions for FreeBSD native targets John Baldwin
2021-05-28 20:26 ` [PATCH 1/5] Add regcache_map_supplies helper routine John Baldwin
2021-07-10 19:25   ` Pedro Alves
2021-07-12 13:13     ` John Baldwin
2021-07-12 13:21       ` Pedro Alves [this message]
2021-05-28 20:26 ` [PATCH 2/5] fbsd-nat: Add helper functions to fetch and store register sets John Baldwin
2021-07-10 19:42   ` Pedro Alves
2021-07-12 15:56     ` John Baldwin
2021-05-28 20:26 ` [PATCH 3/5] riscv-fbsd-nat: Use fetch_register_set and store_register_set John Baldwin
2021-05-28 20:26 ` [PATCH 4/5] aarch64-fbsd-nat: " John Baldwin
2021-05-28 20:26 ` [PATCH 5/5] arm-fbsd-nat: " John Baldwin
2021-06-12 23:17 ` [PATCH 0/5] Add helper functions for FreeBSD native targets John Baldwin
2021-07-09 18:37   ` [PING] " John Baldwin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4dcce04-b0a8-73cb-f468-fd3c357d6bbd@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    --cc=jhb@FreeBSD.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).