[PATCH] Support large registers in regcache transfer_regset

Simon Marchi simark@simark.ca
Tue Jun 19 14:52:00 GMT 2018


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



More information about the Gdb-patches mailing list