From: Alan Hayward <Alan.Hayward@arm.com>
To: Simon Marchi <simark@simark.ca>
Cc: GDB Patches <gdb-patches@sourceware.org>, nd <nd@arm.com>
Subject: Re: [PATCH] Support large registers in regcache transfer_regset
Date: Tue, 19 Jun 2018 15:46:00 -0000 [thread overview]
Message-ID: <AFFC93A3-E4DE-4DDD-AE2D-53ECD0551DA2@arm.com> (raw)
In-Reply-To: <d3bb9490d3f0e4aa45e02f44953ef51d@simark.ca>
> On 19 Jun 2018, at 15:52, Simon Marchi <simark@simark.ca> wrote:
>
> On 2018-06-19 07:27, Alan Hayward wrote:
>>>> +/* See regcache.h. */
>>>> +
>>>> +void
>>>> +reg_buffer::raw_collect_part (int regnum, int offset, int len, void *in) const
>>>> +{
>>>> + struct gdbarch *gdbarch = arch ();
>>>> + gdb_byte *reg = (gdb_byte *) alloca (register_size (gdbarch, regnum));
>>>> +
>>>> + gdb_assert (in != NULL);
>>>> + gdb_assert (offset >= 0 && offset <= m_descr->sizeof_register[regnum]);
>>>> + gdb_assert (len >= 0 && offset + len <= m_descr->sizeof_register[regnum]);
>>> The "&& offset <= m_descr->sizeof_register[regnum]" is redundant, given the
>>> following line. Other than mimicking raw_read_part, is there a reason why
>>> these are signed integers? Having them unsigned would avoid having to assert
>>> they are >= 0.
>> Looking at regcache, int is used for regnum throughout. I’d rather not have a
>> mismatch, and wouldn’t want to update everything else either (at least not
>> in this patch). In addition, if this code is going to now call down to
>> raw_collect/raw_supply, they should match.
>
> Sorry, I was talking about len and offset, not regnum.
>
> Simon
Ah, ok. If doing that, then it’d make sense to update regcache_map_entry to use
unsigned ints for count and size.
struct regcache_map_entry
{
int count;
int regno;
int size;
};
At that point it probably makes sense to repost the patch as v2 in smaller pieces?
Alan.
next prev parent reply other threads:[~2018-06-19 15:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-12 8:04 Alan Hayward
2018-06-17 2:52 ` Simon Marchi
2018-06-19 11:28 ` Alan Hayward
2018-06-19 14:52 ` Simon Marchi
2018-06-19 15:46 ` Alan Hayward [this message]
2018-06-19 21:12 ` Simon Marchi
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=AFFC93A3-E4DE-4DDD-AE2D-53ECD0551DA2@arm.com \
--to=alan.hayward@arm.com \
--cc=gdb-patches@sourceware.org \
--cc=nd@arm.com \
--cc=simark@simark.ca \
/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