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 9/11] Add MN10300_MAX_REGISTER_SIZE (1)


Alan Hayward <Alan.Hayward@arm.com> writes:

> diff --git a/gdb/mn10300-linux-tdep.c b/gdb/mn10300-linux-tdep.c
> index 8c23f02b2b58b29b10a65df5ae0b4bcdce2925cd..44707e8e241d0fddfb4f1e24821941bf6679b9a3 100644
> --- a/gdb/mn10300-linux-tdep.c
> +++ b/gdb/mn10300-linux-tdep.c
> @@ -86,7 +86,6 @@ am33_supply_gregset_method (const struct regset *regset,
>  			    struct regcache *regcache,
>  			    int regnum, const void *gregs, size_t len)
>  {
> -  char zerobuf[MAX_REGISTER_SIZE];
>    const mn10300_elf_greg_t *regp = (const mn10300_elf_greg_t *) gregs;
>    int i;
>
> @@ -188,17 +187,13 @@ am33_supply_gregset_method (const struct regset *regset,
>
>      /* ssp, msp, and usp are inaccessible.  */

As this comment explained, these registers are inaccessible, so we can
treat them unavailable, then, we just do

 regcache_raw_supply (regcache, E_E8_REGNUM, NULL);

but this changes the functionality.  I don't know about this
architecture.

>    case E_E8_REGNUM:
> -    memset (zerobuf, 0, MAX_REGISTER_SIZE);
> -    regcache_raw_supply (regcache, E_E8_REGNUM, zerobuf);
> +    regcache->raw_supply_zeroed (E_E8_REGNUM);
>      break;

Your patch is still good to me, as it doesn't change the functionality.

-- 
Yao (齐尧)


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