This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 11/11] Add SH_MAX_REGISTER_SIZE and SH64_MAX_REGISTER_SIZE
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Alan Hayward <Alan dot Hayward at arm dot com>
- Cc: "gdb-patches\@sourceware.org" <gdb-patches at sourceware dot org>, nd <nd at arm dot com>
- Date: Tue, 06 Jun 2017 15:31:36 +0100
- Subject: Re: [PATCH 11/11] Add SH_MAX_REGISTER_SIZE and SH64_MAX_REGISTER_SIZE
- Authentication-results: sourceware.org; auth=none
- References: <BA394ECE-9E01-40D3-91EB-BCBD89FE4EAE@arm.com> <8637dfw5kl.fsf@gmail.com> <45FE08DA-87EC-48FB-97EC-8463A473126F@arm.com> <44AA3E84-BCF8-4A36-ADF5-83C0DE7771BE@arm.com>
Alan Hayward <Alan.Hayward@arm.com> writes:
> @@ -1528,7 +1531,7 @@ sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
> enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
> int base_regnum;
> int offset = 0;
> - gdb_byte temp_buffer[MAX_REGISTER_SIZE];
> + gdb_byte temp_buffer[SH64_MAX_REGISTER_SIZE];
> enum register_status status;
>
> if (reg_nr >= DR0_REGNUM
> @@ -1704,7 +1707,7 @@ sh64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
> enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
> int base_regnum, portion;
> int offset;
> - gdb_byte temp_buffer[MAX_REGISTER_SIZE];
> + gdb_byte temp_buffer[SH64_MAX_REGISTER_SIZE];
Could you define temp_buffer in each block where it is used? The size
of register is known at each place. In some places, we don't need to
use temp_buffer, instead, we can use regcache_raw_read_unsigned to
replace regcache_raw_read+extract_unsigned_integer. Then, we don't need
SH64_MAX_REGISTER_SIZE at all.
--
Yao (齐尧)