Re: [PATCH v2 11/13] TILEGX Linux: Fill 'collect_regset' in regset structure.

Ulrich Weigand
2014-07-15T10:01:03Z

Andreas Arnez wrote:

> gdb/
> * tilegx-linux-tdep.c (tilegx_linux_supply_regset): Delete
> function. Move logic to...
> (tilegx_linux_regmap): ... this new register map.
> (TILEGX_GREGS_SIZE): New enum value.
> (tilegx_linux_regset): Refer to register map, replace supply
> method by regcache_supply_regset, and add collect method.

> +static const struct regcache_map_entry tilegx_linux_regmap[] =
> + {
> + { TILEGX_NUM_EASY_REGS, 0 },

Maybe TILEGX_R0_REGNUM instead of 0?

> + { 1, TILEGX_PC_REGNUM },

This seems to get the register size wrong in 32-bit mode; note
that TILEGX_PC_REGNUM has type builtin_func_ptr, which may be
4 bytes in size ...

> + { 1, TILEGX_FAULTNUM_REGNUM },
> + { 0 }
> + };
>
> - if (regnum == gri || regnum == -1)
> - regcache_raw_supply (regcache, gri, ptr);
> - }
> -}
> +enum
> +{
> + TILEGX_GREGS_SIZE = (TILEGX_NUM_EASY_REGS + 2) * tilegx_reg_size
> +};

This doesn't appear to be used here.

Bye,
Ulrich

--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com