This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Return bytes for tdesc_register_size()
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: Alan Hayward <alan dot hayward at arm dot com>, <gdb-patches at sourceware dot org>
- Cc: <nd at arm dot com>
- Date: Tue, 10 Jul 2018 14:44:51 -0400
- Subject: Re: [PATCH] Return bytes for tdesc_register_size()
- References: <20180710150542.93363-1-alan.hayward@arm.com>
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