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 11/11] Add SH_MAX_REGISTER_SIZE and SH64_MAX_REGISTER_SIZE


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 (齐尧)


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