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 4/11] Add PPC_MAX_REGISTER_SIZE


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

> Max size set to 128bits, which I determined using regformats/rs6000/powerpc*.dat
>
> Tested on a --enable-targets=all build using make check with board files
> unix and native-gdbserver.
>
> I do not have a PPC machine to test on.

Note that some files you changed are not built, like *-nat.c.  Could you
test your patch on gcc compile farm?  There are some POWER machine you
can use.

https://gcc.gnu.org/wiki/CompileFarm

>
> Ok to commit?
>
> Alan.
>
> 2017-04-04  Alan Hayward  <alan.hayward@arm.com>
>
> 	* ppc-linux-nat.c (fetch_register): Use PPC_MAX_REGISTER_SIZE.
> 	(store_register): Likewise.
> 	* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Likewise.
> 	(get_decimal_float_return_value): Likewise.
> 	(do_ppc_sysv_return_value): Likewise.
> 	(ppc64_sysv_abi_push_integer): Likewise.
> 	(ppc64_sysv_abi_push_freg): Likewise.
> 	(ppc64_sysv_abi_return_value_base): Likewise.
> 	(ppc64_sysv_abi_return_value): Likewise.
> 	* rs6000-aix-tdep.c (rs6000_push_dummy_call): Likewise.
> 	* grs6000-lynx178-tdep.c (rs6000_lynx178_push_dummy_call): Likewise.

s/grs6000/rs6000/

> 	* grs6000-nat.c: Likewise.
> 	* grs6000-tdep.c (rs6000_register_to_value): Likewise.
> 	(rs6000_value_to_register): Likewise.
> 	* ppc-tdep.h (PPC_MAX_REGISTER_SIZE): Add.
>
>

> diff --git a/gdb/ppc-tdep.h b/gdb/ppc-tdep.h
> index 875ad93b184dfb7d8076f6108453833d88b64e47..83e12abacd333bb5bcfd4d2dff28dc342494ad9a 100644
> --- a/gdb/ppc-tdep.h
> +++ b/gdb/ppc-tdep.h
> @@ -304,6 +304,9 @@ enum {
>    PPC_NUM_REGS
>  };
>
> +/* Big enough to hold the size of the largest register in bytes.  */
> +#define PPC_MAX_REGISTER_SIZE	16
> +
>  /* An instruction to match.  */

PPC has so many variants that it is hard to claim the max register size
is 16 byte.  A conservative approach is still keep using 64.  It is not
very smart, but at least won't break anything, IMO.

-- 
Yao (齐尧)


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