This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Return bytes for tdesc_register_size()


On 2018-07-10 11:05 AM, Alan Hayward wrote:
> tdesc_register_size returns number of bits.
> Change this to use bytes, the same as regcache::register_size, memcpy and sizeof.
> 
> This fixes a bug in aarch64_get_tdesc_vq which assumed bytes.
> 
> Update all other calls to tdesc_register_size.
> 
> I originally planned to fix aarch64_get_tdesc_vq and push as OBV.
> However, this seemed the better fix.
> Required for 8.2
> Tested with make check on a target all build.
> I don't have a rs6000 machine, however change is simple enough.

Hi Alan,

Since I work with processors that have 16-bit bytes, I always prefer
expressing sizes in bits, otherwise it's ambiguous.  Are we talking
about 8-bit bytes or target-sized bytes?  So I would have perhaps
chosen to rename tdesc_register_size to tdesc_register_size_bits
(for clarity) and fix up the caller.

Would you be ok with that?  Other than that, the patch looks fine.

Simon


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]