From: Simon Marchi <simark@simark.ca>
To: Alan Hayward <Alan.Hayward@arm.com>
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 14:52:00 -0000 [thread overview]
Message-ID: <d3bb9490d3f0e4aa45e02f44953ef51d@simark.ca> (raw)
In-Reply-To: <85CCB6E0-63F0-4298-B328-D43D3207A91E@arm.com>
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
next prev parent reply other threads:[~2018-06-19 14:52 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 [this message]
2018-06-19 15:46 ` Alan Hayward
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=d3bb9490d3f0e4aa45e02f44953ef51d@simark.ca \
--to=simark@simark.ca \
--cc=Alan.Hayward@arm.com \
--cc=gdb-patches@sourceware.org \
--cc=nd@arm.com \
/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