This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] gdbarch: Use an anonymous union for target data in `gdbarch_info'
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: "Maciej W. Rozycki" <macro at imgtec dot com>, <gdb-patches at sourceware dot org>
- Cc: Yao Qi <qiyaoltc at gmail dot com>
- Date: Tue, 1 Aug 2017 20:34:15 +0200
- Subject: Re: [PATCH v2] gdbarch: Use an anonymous union for target data in `gdbarch_info'
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=simon dot marchi at ericsson dot com;
- References: <alpine.DEB.2.00.1707291508210.29991@tp.orcam.me.uk>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
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