diff options
author | Maciej W. Rozycki <macro@imgtec.com> | 2017-08-07 15:53:54 +0100 |
---|---|---|
committer | Maciej W. Rozycki <macro@imgtec.com> | 2017-08-07 15:53:54 +0100 |
commit | 0dba2a6c09c4010dfb2eb5abdd991208374947c4 (patch) | |
tree | 260d403ab4971933f926804ce310f6f2f4b13e02 /gdb/amd64-linux-tdep.c | |
parent | 16eb6b2db49e6cf2fdca56efd37689fcc170cd37 (diff) | |
download | gdb-0dba2a6c09c4010dfb2eb5abdd991208374947c4.zip gdb-0dba2a6c09c4010dfb2eb5abdd991208374947c4.tar.gz gdb-0dba2a6c09c4010dfb2eb5abdd991208374947c4.tar.bz2 |
gdbarch: Use an anonymous union for target data in `gdbarch_info'
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.
Diffstat (limited to 'gdb/amd64-linux-tdep.c')
-rw-r--r-- | gdb/amd64-linux-tdep.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index cf24789..31d2b16 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -1863,8 +1863,7 @@ static void amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - struct tdesc_arch_data *tdesc_data - = (struct tdesc_arch_data *) info.tdep_info; + struct tdesc_arch_data *tdesc_data = info.tdesc_data; const struct tdesc_feature *feature; int valid_p; @@ -2077,8 +2076,7 @@ static void amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - struct tdesc_arch_data *tdesc_data - = (struct tdesc_arch_data *) info.tdep_info; + struct tdesc_arch_data *tdesc_data = info.tdesc_data; const struct tdesc_feature *feature; int valid_p; |