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 v2] gdbarch: Use an anonymous union for target data in `gdbarch_info'


On 2017-08-01 05:52 PM, Maciej W. Rozycki wrote:
> As an update to commit ede5f15146ae ("gdbarch.h: Change 
> gdbarch_info::tdep_info's type to void *") replace the definition of the 
> `tdep_info' member in `struct gdbarch_info' with an anonymous union, 
> comprising the original member, with its type reverted to `struct 
> gdbarch_tdep_info *', a `tdesc_data' member of a `struct tdesc_arch_data 
> *' type and an `id' member of an `int *' type.  Remove now unnecessary 
> casts throughout use places then, making code easier to read an less 
> prone to errors, which may happen with casting.
> 
> 	gdb/
> 	* gdbarch.sh (gdbarch_info): Replace the `tdep_info' member with
> 	a union of `tdep_info', `tdesc_data' and `id'.
> 	* aarch64-tdep.c (aarch64_gdbarch_init): Use `info.tdesc_data' 
> 	rather than `info.tdep_info'.
> 	* amd64-linux-tdep.c (amd64_linux_init_abi): Likewise.
> 	* i386-linux-tdep.c (i386_linux_init_abi): Likewise.
> 	* i386-tdep.c (i386_gdbarch_init): Likewise.
> 	* mips-linux-tdep.c (mips_linux_init_abi): Likewise.
> 	* mips-tdep.c (mips_gdbarch_init): Likewise.
> 	* nds32-tdep.c (nds32_gdbarch_init): Likewise.
> 	* rs6000-tdep.c (rs6000_gdbarch_init): Likewise.
> 	* ppc-linux-tdep.c (ppu2spu_sniffer): Use `info.id' rather than 
> 	`info.tdep_info'.
> 	(ppc_linux_init_abi): Use `info.tdesc_data' rather than 
> 	`info.tdep_info'.
> 	* sparc-tdep.c (sparc32_gdbarch_init): Likewise.
> 	* spu-multiarch.c (spu_gdbarch): Use `info.id' rather than
> 	`info.tdep_info'.
> 	* spu-tdep.c (spu_gdbarch_init): Likewise.
> 	* gdbarch.h: Regenerate.
> ---
> Hi,
> 
>  Rebased and updated as requested, see the change log below and: 
> <https://patchwork.sourceware.org/patch/16622/> for the earlier 
> discussion.  Verified to build with `--enable-targets=all' and no 
> regressions with `mips-linux-gnu' and `x86_64-linux-gnu' targets.
> 
>  OK to apply?
> 
>   Maciej
> 
> Changes from v1:
> 
> - Descriptions for new union members added.
> 
> - SPARC backend modification added according to changes made on master 
>   since the original submission.

Hi Maciej,

This LGTM.

Simon


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