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>,
- Date: Tue, 11 Apr 2017 12:23:54 +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>
Alan Hayward <Alan.Hayward@arm.com> writes:
> diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
> index 9b3692dc0c32ffcb53d99f0fc095303d2c221fcb..7e56864202fe9321edb7561c721ef912b3a4f8c5 100644
> --- a/gdb/sh-tdep.c
> +++ b/gdb/sh-tdep.c
> @@ -1648,7 +1648,7 @@ sh_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
> int reg_nr, gdb_byte *buffer)
> {
> int base_regnum;
> - gdb_byte temp_buffer[MAX_REGISTER_SIZE];
> + gdb_byte temp_buffer[SH_MAX_REGISTER_SIZE];
> enum register_status status;
>
> if (reg_nr == PSEUDO_BANK_REGNUM)
temp_buffer is used for double float register, which is from two fp
registers,
else if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM)
{
base_regnum = dr_reg_base_num (gdbarch, reg_nr);
/* Build the value in the provided buffer. */
/* Read the real regs for which this one is an alias. */
status = pseudo_register_read_portions (gdbarch, regcache,
2, base_regnum, temp_buffer);
if (status == REG_VALID)
{
/* We must pay attention to the endiannes. */
sh_register_convert_to_virtual (gdbarch, reg_nr,
register_type (gdbarch, reg_nr),
temp_buffer, buffer);
}
Can you move "temp_buffer" into this block, and define it
gdb_byte temp_buffer[4 * 2] or temp_buffer[SH_FLOAT_REGISTER_SIZE * 2];
--
Yao (齐尧)