* [PATCH] gdb: include gdbarch.h in all files extending gdbarch_tdep
@ 2021-11-17 17:13 Simon Marchi
2021-11-17 23:49 ` Andrew Burgess
0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi @ 2021-11-17 17:13 UTC (permalink / raw)
To: gdb-patches
Commit 345bd07cce33 ("gdb: fix gdbarch_tdep ODR violation") made a bunch
of files define a *_gdbarch_tdep class that inherits from a gdbarch_tdep
base. But some of these files don't include gdbarch.h, where
gdbarch_tdep is defined. This may cause build errors if gdbarch.h isn't
already included by chance by some other header file. Avoid this by
making them include gdbarch.h.
Change-Id: If433d302007e274daa4f656cfc94f769cf1aa68a
---
gdb/avr-tdep.c | 1 +
gdb/bfin-tdep.h | 2 ++
gdb/bpf-tdep.c | 1 +
gdb/cris-tdep.h | 2 ++
gdb/csky-tdep.h | 2 ++
gdb/frv-tdep.c | 1 +
gdb/ft32-tdep.h | 2 ++
gdb/lm32-tdep.c | 1 +
gdb/m32c-tdep.c | 1 +
gdb/m68hc11-tdep.c | 1 +
gdb/m68k-tdep.h | 2 ++
gdb/mep-tdep.c | 1 +
gdb/microblaze-tdep.h | 1 +
gdb/mips-tdep.h | 1 +
gdb/moxie-tdep.h | 2 ++
gdb/msp430-tdep.c | 1 +
gdb/nds32-tdep.h | 2 ++
gdb/or1k-tdep.c | 1 +
gdb/rl78-tdep.c | 1 +
gdb/rx-tdep.c | 1 +
gdb/s12z-tdep.c | 1 +
gdb/s390-tdep.h | 1 +
gdb/v850-tdep.c | 1 +
gdb/z80-tdep.c | 1 +
24 files changed, 31 insertions(+)
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 0db19865f312..a97c4450acb9 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -37,6 +37,7 @@
#include "dis-asm.h"
#include "objfiles.h"
#include <algorithm>
+#include "gdbarch.h"
/* AVR Background:
diff --git a/gdb/bfin-tdep.h b/gdb/bfin-tdep.h
index 70a18547e6ba..13f5c1ba6240 100644
--- a/gdb/bfin-tdep.h
+++ b/gdb/bfin-tdep.h
@@ -22,6 +22,8 @@
#ifndef BFIN_TDEP_H
#define BFIN_TDEP_H
+#include "gdbarch.h"
+
enum gdb_regnum {
/* Core Registers */
BFIN_R0_REGNUM = 0,
diff --git a/gdb/bpf-tdep.c b/gdb/bpf-tdep.c
index b2cd913d9e1b..6f07dce0bb65 100644
--- a/gdb/bpf-tdep.c
+++ b/gdb/bpf-tdep.c
@@ -34,6 +34,7 @@
#include "osabi.h"
#include "target-descriptions.h"
#include "remote.h"
+#include "gdbarch.h"
\f
/* eBPF registers. */
diff --git a/gdb/cris-tdep.h b/gdb/cris-tdep.h
index 9b622942839f..57a3aedcaeee 100644
--- a/gdb/cris-tdep.h
+++ b/gdb/cris-tdep.h
@@ -23,6 +23,8 @@
#ifndef CRIS_TDEP_H
#define CRIS_TDEP_H
+#include "gdbarch.h"
+
/* CRIS architecture specific information. */
struct cris_gdbarch_tdep : gdbarch_tdep
{
diff --git a/gdb/csky-tdep.h b/gdb/csky-tdep.h
index d690e8f51917..dfbeefc2f2b5 100644
--- a/gdb/csky-tdep.h
+++ b/gdb/csky-tdep.h
@@ -20,6 +20,8 @@
#ifndef CSKY_TDEP_H
#define CSKY_TDEP_H
+#include "gdbarch.h"
+
/* How to interpret the contents of the link register. */
enum lr_type_t
{
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index c5eac6b61b5a..09274d54a0e5 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -38,6 +38,7 @@
#include "solib.h"
#include "frv-tdep.h"
#include "objfiles.h"
+#include "gdbarch.h"
struct frv_unwind_cache /* was struct frame_extra_info */
{
diff --git a/gdb/ft32-tdep.h b/gdb/ft32-tdep.h
index c32f646a4a0f..8ec1c5c104eb 100644
--- a/gdb/ft32-tdep.h
+++ b/gdb/ft32-tdep.h
@@ -20,6 +20,8 @@
#ifndef FT32_TDEP_H
#define FT32_TDEP_H
+#include "gdbarch.h"
+
struct ft32_gdbarch_tdep : gdbarch_tdep
{
/* Type for a pointer to a function. Used for the type of PC. */
diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c
index 3f91c050b470..6fa19c8a4129 100644
--- a/gdb/lm32-tdep.c
+++ b/gdb/lm32-tdep.c
@@ -34,6 +34,7 @@
#include "reggroups.h"
#include "opcodes/lm32-desc.h"
#include <algorithm>
+#include "gdbarch.h"
/* Macros to extract fields from an instruction. */
#define LM32_OPCODE(insn) ((insn >> 26) & 0x3f)
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
index 200d51a16b1b..2afe0798549c 100644
--- a/gdb/m32c-tdep.c
+++ b/gdb/m32c-tdep.c
@@ -30,6 +30,7 @@
#include "reggroups.h"
#include "prologue-value.h"
#include "objfiles.h"
+#include "gdbarch.h"
\f
/* The m32c tdep structure. */
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index 6d41fe85f956..146b6bbaefc9 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -38,6 +38,7 @@
#include "arch-utils.h"
#include "regcache.h"
#include "reggroups.h"
+#include "gdbarch.h"
#include "target.h"
#include "opcode/m68hc11.h"
diff --git a/gdb/m68k-tdep.h b/gdb/m68k-tdep.h
index c88e7f26da5a..66c467b6ae75 100644
--- a/gdb/m68k-tdep.h
+++ b/gdb/m68k-tdep.h
@@ -20,6 +20,8 @@
#ifndef M68K_TDEP_H
#define M68K_TDEP_H
+#include "gdbarch.h"
+
struct frame_info;
/* Register numbers of various important registers. */
diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c
index 6d1f04a2ab2c..645fac56c38d 100644
--- a/gdb/mep-tdep.c
+++ b/gdb/mep-tdep.c
@@ -45,6 +45,7 @@
#include "prologue-value.h"
#include "cgen/bitset.h"
#include "infcall.h"
+#include "gdbarch.h"
/* Get the user's customized MeP coprocessor register names from
libopcodes. */
diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h
index 3143e92ac74d..732c611911df 100644
--- a/gdb/microblaze-tdep.h
+++ b/gdb/microblaze-tdep.h
@@ -20,6 +20,7 @@
#ifndef MICROBLAZE_TDEP_H
#define MICROBLAZE_TDEP_H 1
+#include "gdbarch.h"
/* Microblaze architecture-specific information. */
struct microblaze_gdbarch_tdep : gdbarch_tdep
diff --git a/gdb/mips-tdep.h b/gdb/mips-tdep.h
index b899cfd9bdb1..cc42e74e85de 100644
--- a/gdb/mips-tdep.h
+++ b/gdb/mips-tdep.h
@@ -21,6 +21,7 @@
#define MIPS_TDEP_H
#include "objfiles.h"
+#include "gdbarch.h"
struct gdbarch;
diff --git a/gdb/moxie-tdep.h b/gdb/moxie-tdep.h
index 4e6bcd1c1c95..bd9840f3e021 100644
--- a/gdb/moxie-tdep.h
+++ b/gdb/moxie-tdep.h
@@ -20,6 +20,8 @@
#ifndef MOXIE_TDEP_H
#define MOXIE_TDEP_H
+#include "gdbarch.h"
+
struct moxie_gdbarch_tdep : gdbarch_tdep
{
/* gdbarch target dependent data here. Currently unused for MOXIE. */
diff --git a/gdb/msp430-tdep.c b/gdb/msp430-tdep.c
index f3c44b71ba57..7458c784871a 100644
--- a/gdb/msp430-tdep.c
+++ b/gdb/msp430-tdep.c
@@ -34,6 +34,7 @@
#include "gdbcore.h"
#include "dwarf2/frame.h"
#include "reggroups.h"
+#include "gdbarch.h"
#include "elf/msp430.h"
#include "opcode/msp430-decode.h"
diff --git a/gdb/nds32-tdep.h b/gdb/nds32-tdep.h
index e06512323f9a..1446be861fe6 100644
--- a/gdb/nds32-tdep.h
+++ b/gdb/nds32-tdep.h
@@ -21,6 +21,8 @@
#ifndef NDS32_TDEP_H
#define NDS32_TDEP_H
+#include "gdbarch.h"
+
enum nds32_regnum
{
/* General purpose registers. */
diff --git a/gdb/or1k-tdep.c b/gdb/or1k-tdep.c
index 346ee97c49b6..fb92929d1767 100644
--- a/gdb/or1k-tdep.c
+++ b/gdb/or1k-tdep.c
@@ -42,6 +42,7 @@
#include "target-descriptions.h"
#include <inttypes.h>
#include "dis-asm.h"
+#include "gdbarch.h"
/* OpenRISC specific includes. */
#include "or1k-tdep.h"
diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c
index 616dafb1721b..8c5749fb9cc0 100644
--- a/gdb/rl78-tdep.c
+++ b/gdb/rl78-tdep.c
@@ -34,6 +34,7 @@
#include "gdbcore.h"
#include "dwarf2/frame.h"
#include "reggroups.h"
+#include "gdbarch.h"
#include "elf/rl78.h"
#include "elf-bfd.h"
diff --git a/gdb/rx-tdep.c b/gdb/rx-tdep.c
index 73e708b6462d..3f7d70d448f2 100644
--- a/gdb/rx-tdep.c
+++ b/gdb/rx-tdep.c
@@ -35,6 +35,7 @@
#include "dwarf2/frame.h"
#include "remote.h"
#include "target-descriptions.h"
+#include "gdbarch.h"
#include "elf/rx.h"
#include "elf-bfd.h"
diff --git a/gdb/s12z-tdep.c b/gdb/s12z-tdep.c
index ca4fe0a3c717..97bcb8b3965d 100644
--- a/gdb/s12z-tdep.c
+++ b/gdb/s12z-tdep.c
@@ -31,6 +31,7 @@
#include "trad-frame.h"
#include "remote.h"
#include "opcodes/s12z-opc.h"
+#include "gdbarch.h"
/* Two of the registers included in S12Z_N_REGISTERS are
the CCH and CCL "registers" which are just views into
diff --git a/gdb/s390-tdep.h b/gdb/s390-tdep.h
index 191977ecf503..6fd371095d7d 100644
--- a/gdb/s390-tdep.h
+++ b/gdb/s390-tdep.h
@@ -21,6 +21,7 @@
#define S390_TDEP_H
#include "prologue-value.h"
+#include "gdbarch.h"
enum s390_abi_kind
{
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index 70f6d42a95b1..087574876f68 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -32,6 +32,7 @@
#include "osabi.h"
#include "elf-bfd.h"
#include "elf/v850.h"
+#include "gdbarch.h"
enum
{
diff --git a/gdb/z80-tdep.c b/gdb/z80-tdep.c
index 9d453cd32b95..303b5dabb8f8 100644
--- a/gdb/z80-tdep.c
+++ b/gdb/z80-tdep.c
@@ -30,6 +30,7 @@
#include "inferior.h"
#include "objfiles.h"
#include "symfile.h"
+#include "gdbarch.h"
#include "z80-tdep.h"
#include "features/z80.c"
--
2.26.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gdb: include gdbarch.h in all files extending gdbarch_tdep
2021-11-17 17:13 [PATCH] gdb: include gdbarch.h in all files extending gdbarch_tdep Simon Marchi
@ 2021-11-17 23:49 ` Andrew Burgess
2021-11-18 16:31 ` Simon Marchi
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Burgess @ 2021-11-17 23:49 UTC (permalink / raw)
To: Simon Marchi; +Cc: gdb-patches
* Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> [2021-11-17 12:13:47 -0500]:
> Commit 345bd07cce33 ("gdb: fix gdbarch_tdep ODR violation") made a bunch
> of files define a *_gdbarch_tdep class that inherits from a gdbarch_tdep
> base. But some of these files don't include gdbarch.h, where
> gdbarch_tdep is defined. This may cause build errors if gdbarch.h isn't
> already included by chance by some other header file. Avoid this by
> making them include gdbarch.h.
LGTM.
Thanks,
Andrew
>
> Change-Id: If433d302007e274daa4f656cfc94f769cf1aa68a
> ---
> gdb/avr-tdep.c | 1 +
> gdb/bfin-tdep.h | 2 ++
> gdb/bpf-tdep.c | 1 +
> gdb/cris-tdep.h | 2 ++
> gdb/csky-tdep.h | 2 ++
> gdb/frv-tdep.c | 1 +
> gdb/ft32-tdep.h | 2 ++
> gdb/lm32-tdep.c | 1 +
> gdb/m32c-tdep.c | 1 +
> gdb/m68hc11-tdep.c | 1 +
> gdb/m68k-tdep.h | 2 ++
> gdb/mep-tdep.c | 1 +
> gdb/microblaze-tdep.h | 1 +
> gdb/mips-tdep.h | 1 +
> gdb/moxie-tdep.h | 2 ++
> gdb/msp430-tdep.c | 1 +
> gdb/nds32-tdep.h | 2 ++
> gdb/or1k-tdep.c | 1 +
> gdb/rl78-tdep.c | 1 +
> gdb/rx-tdep.c | 1 +
> gdb/s12z-tdep.c | 1 +
> gdb/s390-tdep.h | 1 +
> gdb/v850-tdep.c | 1 +
> gdb/z80-tdep.c | 1 +
> 24 files changed, 31 insertions(+)
>
> diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
> index 0db19865f312..a97c4450acb9 100644
> --- a/gdb/avr-tdep.c
> +++ b/gdb/avr-tdep.c
> @@ -37,6 +37,7 @@
> #include "dis-asm.h"
> #include "objfiles.h"
> #include <algorithm>
> +#include "gdbarch.h"
>
> /* AVR Background:
>
> diff --git a/gdb/bfin-tdep.h b/gdb/bfin-tdep.h
> index 70a18547e6ba..13f5c1ba6240 100644
> --- a/gdb/bfin-tdep.h
> +++ b/gdb/bfin-tdep.h
> @@ -22,6 +22,8 @@
> #ifndef BFIN_TDEP_H
> #define BFIN_TDEP_H
>
> +#include "gdbarch.h"
> +
> enum gdb_regnum {
> /* Core Registers */
> BFIN_R0_REGNUM = 0,
> diff --git a/gdb/bpf-tdep.c b/gdb/bpf-tdep.c
> index b2cd913d9e1b..6f07dce0bb65 100644
> --- a/gdb/bpf-tdep.c
> +++ b/gdb/bpf-tdep.c
> @@ -34,6 +34,7 @@
> #include "osabi.h"
> #include "target-descriptions.h"
> #include "remote.h"
> +#include "gdbarch.h"
>
> \f
> /* eBPF registers. */
> diff --git a/gdb/cris-tdep.h b/gdb/cris-tdep.h
> index 9b622942839f..57a3aedcaeee 100644
> --- a/gdb/cris-tdep.h
> +++ b/gdb/cris-tdep.h
> @@ -23,6 +23,8 @@
> #ifndef CRIS_TDEP_H
> #define CRIS_TDEP_H
>
> +#include "gdbarch.h"
> +
> /* CRIS architecture specific information. */
> struct cris_gdbarch_tdep : gdbarch_tdep
> {
> diff --git a/gdb/csky-tdep.h b/gdb/csky-tdep.h
> index d690e8f51917..dfbeefc2f2b5 100644
> --- a/gdb/csky-tdep.h
> +++ b/gdb/csky-tdep.h
> @@ -20,6 +20,8 @@
> #ifndef CSKY_TDEP_H
> #define CSKY_TDEP_H
>
> +#include "gdbarch.h"
> +
> /* How to interpret the contents of the link register. */
> enum lr_type_t
> {
> diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
> index c5eac6b61b5a..09274d54a0e5 100644
> --- a/gdb/frv-tdep.c
> +++ b/gdb/frv-tdep.c
> @@ -38,6 +38,7 @@
> #include "solib.h"
> #include "frv-tdep.h"
> #include "objfiles.h"
> +#include "gdbarch.h"
>
> struct frv_unwind_cache /* was struct frame_extra_info */
> {
> diff --git a/gdb/ft32-tdep.h b/gdb/ft32-tdep.h
> index c32f646a4a0f..8ec1c5c104eb 100644
> --- a/gdb/ft32-tdep.h
> +++ b/gdb/ft32-tdep.h
> @@ -20,6 +20,8 @@
> #ifndef FT32_TDEP_H
> #define FT32_TDEP_H
>
> +#include "gdbarch.h"
> +
> struct ft32_gdbarch_tdep : gdbarch_tdep
> {
> /* Type for a pointer to a function. Used for the type of PC. */
> diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c
> index 3f91c050b470..6fa19c8a4129 100644
> --- a/gdb/lm32-tdep.c
> +++ b/gdb/lm32-tdep.c
> @@ -34,6 +34,7 @@
> #include "reggroups.h"
> #include "opcodes/lm32-desc.h"
> #include <algorithm>
> +#include "gdbarch.h"
>
> /* Macros to extract fields from an instruction. */
> #define LM32_OPCODE(insn) ((insn >> 26) & 0x3f)
> diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
> index 200d51a16b1b..2afe0798549c 100644
> --- a/gdb/m32c-tdep.c
> +++ b/gdb/m32c-tdep.c
> @@ -30,6 +30,7 @@
> #include "reggroups.h"
> #include "prologue-value.h"
> #include "objfiles.h"
> +#include "gdbarch.h"
>
> \f
> /* The m32c tdep structure. */
> diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
> index 6d41fe85f956..146b6bbaefc9 100644
> --- a/gdb/m68hc11-tdep.c
> +++ b/gdb/m68hc11-tdep.c
> @@ -38,6 +38,7 @@
> #include "arch-utils.h"
> #include "regcache.h"
> #include "reggroups.h"
> +#include "gdbarch.h"
>
> #include "target.h"
> #include "opcode/m68hc11.h"
> diff --git a/gdb/m68k-tdep.h b/gdb/m68k-tdep.h
> index c88e7f26da5a..66c467b6ae75 100644
> --- a/gdb/m68k-tdep.h
> +++ b/gdb/m68k-tdep.h
> @@ -20,6 +20,8 @@
> #ifndef M68K_TDEP_H
> #define M68K_TDEP_H
>
> +#include "gdbarch.h"
> +
> struct frame_info;
>
> /* Register numbers of various important registers. */
> diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c
> index 6d1f04a2ab2c..645fac56c38d 100644
> --- a/gdb/mep-tdep.c
> +++ b/gdb/mep-tdep.c
> @@ -45,6 +45,7 @@
> #include "prologue-value.h"
> #include "cgen/bitset.h"
> #include "infcall.h"
> +#include "gdbarch.h"
>
> /* Get the user's customized MeP coprocessor register names from
> libopcodes. */
> diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h
> index 3143e92ac74d..732c611911df 100644
> --- a/gdb/microblaze-tdep.h
> +++ b/gdb/microblaze-tdep.h
> @@ -20,6 +20,7 @@
> #ifndef MICROBLAZE_TDEP_H
> #define MICROBLAZE_TDEP_H 1
>
> +#include "gdbarch.h"
>
> /* Microblaze architecture-specific information. */
> struct microblaze_gdbarch_tdep : gdbarch_tdep
> diff --git a/gdb/mips-tdep.h b/gdb/mips-tdep.h
> index b899cfd9bdb1..cc42e74e85de 100644
> --- a/gdb/mips-tdep.h
> +++ b/gdb/mips-tdep.h
> @@ -21,6 +21,7 @@
> #define MIPS_TDEP_H
>
> #include "objfiles.h"
> +#include "gdbarch.h"
>
> struct gdbarch;
>
> diff --git a/gdb/moxie-tdep.h b/gdb/moxie-tdep.h
> index 4e6bcd1c1c95..bd9840f3e021 100644
> --- a/gdb/moxie-tdep.h
> +++ b/gdb/moxie-tdep.h
> @@ -20,6 +20,8 @@
> #ifndef MOXIE_TDEP_H
> #define MOXIE_TDEP_H
>
> +#include "gdbarch.h"
> +
> struct moxie_gdbarch_tdep : gdbarch_tdep
> {
> /* gdbarch target dependent data here. Currently unused for MOXIE. */
> diff --git a/gdb/msp430-tdep.c b/gdb/msp430-tdep.c
> index f3c44b71ba57..7458c784871a 100644
> --- a/gdb/msp430-tdep.c
> +++ b/gdb/msp430-tdep.c
> @@ -34,6 +34,7 @@
> #include "gdbcore.h"
> #include "dwarf2/frame.h"
> #include "reggroups.h"
> +#include "gdbarch.h"
>
> #include "elf/msp430.h"
> #include "opcode/msp430-decode.h"
> diff --git a/gdb/nds32-tdep.h b/gdb/nds32-tdep.h
> index e06512323f9a..1446be861fe6 100644
> --- a/gdb/nds32-tdep.h
> +++ b/gdb/nds32-tdep.h
> @@ -21,6 +21,8 @@
> #ifndef NDS32_TDEP_H
> #define NDS32_TDEP_H
>
> +#include "gdbarch.h"
> +
> enum nds32_regnum
> {
> /* General purpose registers. */
> diff --git a/gdb/or1k-tdep.c b/gdb/or1k-tdep.c
> index 346ee97c49b6..fb92929d1767 100644
> --- a/gdb/or1k-tdep.c
> +++ b/gdb/or1k-tdep.c
> @@ -42,6 +42,7 @@
> #include "target-descriptions.h"
> #include <inttypes.h>
> #include "dis-asm.h"
> +#include "gdbarch.h"
>
> /* OpenRISC specific includes. */
> #include "or1k-tdep.h"
> diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c
> index 616dafb1721b..8c5749fb9cc0 100644
> --- a/gdb/rl78-tdep.c
> +++ b/gdb/rl78-tdep.c
> @@ -34,6 +34,7 @@
> #include "gdbcore.h"
> #include "dwarf2/frame.h"
> #include "reggroups.h"
> +#include "gdbarch.h"
>
> #include "elf/rl78.h"
> #include "elf-bfd.h"
> diff --git a/gdb/rx-tdep.c b/gdb/rx-tdep.c
> index 73e708b6462d..3f7d70d448f2 100644
> --- a/gdb/rx-tdep.c
> +++ b/gdb/rx-tdep.c
> @@ -35,6 +35,7 @@
> #include "dwarf2/frame.h"
> #include "remote.h"
> #include "target-descriptions.h"
> +#include "gdbarch.h"
>
> #include "elf/rx.h"
> #include "elf-bfd.h"
> diff --git a/gdb/s12z-tdep.c b/gdb/s12z-tdep.c
> index ca4fe0a3c717..97bcb8b3965d 100644
> --- a/gdb/s12z-tdep.c
> +++ b/gdb/s12z-tdep.c
> @@ -31,6 +31,7 @@
> #include "trad-frame.h"
> #include "remote.h"
> #include "opcodes/s12z-opc.h"
> +#include "gdbarch.h"
>
> /* Two of the registers included in S12Z_N_REGISTERS are
> the CCH and CCL "registers" which are just views into
> diff --git a/gdb/s390-tdep.h b/gdb/s390-tdep.h
> index 191977ecf503..6fd371095d7d 100644
> --- a/gdb/s390-tdep.h
> +++ b/gdb/s390-tdep.h
> @@ -21,6 +21,7 @@
> #define S390_TDEP_H
>
> #include "prologue-value.h"
> +#include "gdbarch.h"
>
> enum s390_abi_kind
> {
> diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
> index 70f6d42a95b1..087574876f68 100644
> --- a/gdb/v850-tdep.c
> +++ b/gdb/v850-tdep.c
> @@ -32,6 +32,7 @@
> #include "osabi.h"
> #include "elf-bfd.h"
> #include "elf/v850.h"
> +#include "gdbarch.h"
>
> enum
> {
> diff --git a/gdb/z80-tdep.c b/gdb/z80-tdep.c
> index 9d453cd32b95..303b5dabb8f8 100644
> --- a/gdb/z80-tdep.c
> +++ b/gdb/z80-tdep.c
> @@ -30,6 +30,7 @@
> #include "inferior.h"
> #include "objfiles.h"
> #include "symfile.h"
> +#include "gdbarch.h"
>
> #include "z80-tdep.h"
> #include "features/z80.c"
> --
> 2.26.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gdb: include gdbarch.h in all files extending gdbarch_tdep
2021-11-17 23:49 ` Andrew Burgess
@ 2021-11-18 16:31 ` Simon Marchi
0 siblings, 0 replies; 3+ messages in thread
From: Simon Marchi @ 2021-11-18 16:31 UTC (permalink / raw)
To: Andrew Burgess; +Cc: gdb-patches
On 2021-11-17 6:49 p.m., Andrew Burgess wrote:
> * Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> [2021-11-17 12:13:47 -0500]:
>
>> Commit 345bd07cce33 ("gdb: fix gdbarch_tdep ODR violation") made a bunch
>> of files define a *_gdbarch_tdep class that inherits from a gdbarch_tdep
>> base. But some of these files don't include gdbarch.h, where
>> gdbarch_tdep is defined. This may cause build errors if gdbarch.h isn't
>> already included by chance by some other header file. Avoid this by
>> making them include gdbarch.h.
>
> LGTM.
>
> Thanks,
> Andrew
Thanks, pushed.
Simon
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-18 16:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-17 17:13 [PATCH] gdb: include gdbarch.h in all files extending gdbarch_tdep Simon Marchi
2021-11-17 23:49 ` Andrew Burgess
2021-11-18 16:31 ` Simon Marchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).