public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Mark Wielaard <mark@klomp.org>, gdb-patches@sourceware.org
Cc: Mark Wielaard <mark@klomp.org>
Subject: Re: [PATCH] Rename gdbarch_tdep template function to gdbarch_tdep_cast for g++ 4.8
Date: Mon, 25 Jul 2022 12:19:18 +0100	[thread overview]
Message-ID: <87fsipa18p.fsf@redhat.com> (raw)
In-Reply-To: <20220723000228.33276-1-mark@klomp.org>

Mark Wielaard <mark@klomp.org> writes:

> commit 08106042d "gdb: move the type cast into gdbarch_tdep" created
> a template function with the same name as a struct gdbarch_tdep. This
> confused g++ 4.8 believing the struct gdbarch_tdep was an incomplete
> type. Fix this by renaming the template function to gdbarch_tdep_cast.

Honestly, I'm not a fan of the proposed new name.  Using names that end
in _cast should, I think, be reserved for functions that exhibit casting
like behaviour, i.e. take an object, or pointer, and return the same
object, or pointer, converted to some alternative type, which isn't what
we're doing here.

Instead of renaming the function, I'd like to propose that we rename the
structure instead, so 'struct gdbarch_tdep' to 'struct
gdbarch_tdep_base'.

Given the structure is only ever used as a base class, I think the new
name is good, and this allows the function name to be left unchanged.

I tested this on a CentOS VM using g++ 4.8.5, and it seems to build
fine.

Thoughts?

Thanks,
Andrew

---

commit faff6041468dd13b26c5380862752f1039a92dc9
Author: Andrew Burgess <aburgess@redhat.com>
Date:   Mon Jul 25 12:07:11 2022 +0100

    gdb: rename gdbarch_tdep struct to fix g++ 4.8 build
    
    After this commit:
    
      commit 08106042d9f5fdff60c129bf33190639f1a98b2a
      Date:   Thu May 19 13:20:17 2022 +0100
    
          gdb: move the type cast into gdbarch_tdep
    
    GDB would no longer build using g++ 4.8.  The issue appears to be some
    confusion as we have 'struct gdbarch_tdep', but also a templated
    function called 'gdbarch_tdep'.  Prior to the above commit the
    gdbarch_tdep function was not templated, and this compiled just fine.
    
    To resolve this confusion I propose renaming 'struct gdbarch_tdep' to
    'struct gdbarch_tdep_base'.  This rename better represents that the
    struct is only ever used as a base class, and removes the overloading
    of the name, which allows GDB to build with g++ 4.8.

diff --git a/gdb/aarch64-tdep.h b/gdb/aarch64-tdep.h
index b85a3d33cc9..5bdd733dce3 100644
--- a/gdb/aarch64-tdep.h
+++ b/gdb/aarch64-tdep.h
@@ -60,7 +60,7 @@ struct regset;
 #define AARCH64_DISPLACED_MODIFIED_INSNS 1
 
 /* Target-dependent structure in gdbarch.  */
-struct aarch64_gdbarch_tdep : gdbarch_tdep
+struct aarch64_gdbarch_tdep : gdbarch_tdep_base
 {
   /* Lowest address at which instructions will appear.  */
   CORE_ADDR lowest_pc = 0;
diff --git a/gdb/alpha-tdep.h b/gdb/alpha-tdep.h
index 420ea1adc9c..bc4a8407249 100644
--- a/gdb/alpha-tdep.h
+++ b/gdb/alpha-tdep.h
@@ -70,7 +70,7 @@ struct regcache;
 #define ALPHA_NUM_ARG_REGS   6
 
 /* Target-dependent structure in gdbarch.  */
-struct alpha_gdbarch_tdep : gdbarch_tdep
+struct alpha_gdbarch_tdep : gdbarch_tdep_base
 {
   CORE_ADDR vm_min_address = 0;	/* Used by alpha_heuristic_proc_start.  */
 
diff --git a/gdb/arc-tdep.h b/gdb/arc-tdep.h
index 53e5d8476fc..eba435f62f0 100644
--- a/gdb/arc-tdep.h
+++ b/gdb/arc-tdep.h
@@ -121,7 +121,7 @@ extern bool arc_debug;
 
 /* Target-dependent information.  */
 
-struct arc_gdbarch_tdep : gdbarch_tdep
+struct arc_gdbarch_tdep : gdbarch_tdep_base
 {
   /* Offset to PC value in jump buffer.  If this is negative, longjmp
      support will be disabled.  */
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 360b8d694be..4e55b2797b9 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -1200,7 +1200,7 @@ gdbarch_free (struct gdbarch *arch)
 
 /* See gdbarch.h.  */
 
-struct gdbarch_tdep *
+struct gdbarch_tdep_base *
 gdbarch_tdep_1 (struct gdbarch *gdbarch)
 {
   if (gdbarch_debug >= 2)
diff --git a/gdb/arm-tdep.h b/gdb/arm-tdep.h
index 0fc4774a20c..67dd1151da4 100644
--- a/gdb/arm-tdep.h
+++ b/gdb/arm-tdep.h
@@ -87,7 +87,7 @@ enum struct_return
 };
 
 /* Target-dependent structure in gdbarch.  */
-struct arm_gdbarch_tdep : gdbarch_tdep
+struct arm_gdbarch_tdep : gdbarch_tdep_base
 {
   /* The ABI for this architecture.  It should never be set to
      ARM_ABI_AUTO.  */
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 4722f7ee748..357f5bb8f2d 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -189,7 +189,7 @@ struct avr_unwind_cache
   trad_frame_saved_reg *saved_regs;
 };
 
-struct avr_gdbarch_tdep : gdbarch_tdep
+struct avr_gdbarch_tdep : gdbarch_tdep_base
 {
   /* Number of bytes stored to the stack by call instructions.
      2 bytes for avr1-5 and avrxmega1-5, 3 bytes for avr6 and avrxmega6-7.  */
diff --git a/gdb/bfin-tdep.h b/gdb/bfin-tdep.h
index b7e3b9b327c..267149684e0 100644
--- a/gdb/bfin-tdep.h
+++ b/gdb/bfin-tdep.h
@@ -96,7 +96,7 @@ enum bfin_abi
 };
 
 /* Target-dependent structure in gdbarch.  */
-struct bfin_gdbarch_tdep : gdbarch_tdep
+struct bfin_gdbarch_tdep : gdbarch_tdep_base
 {
   /* Which ABI is in use?  */
   enum bfin_abi bfin_abi {};
diff --git a/gdb/bpf-tdep.c b/gdb/bpf-tdep.c
index 09030cf8fa1..a5df478063c 100644
--- a/gdb/bpf-tdep.c
+++ b/gdb/bpf-tdep.c
@@ -58,7 +58,7 @@ enum bpf_regnum
 #define BPF_NUM_REGS	(BPF_PC_REGNUM + 1)
 
 /* Target-dependent structure in gdbarch.  */
-struct bpf_gdbarch_tdep : gdbarch_tdep
+struct bpf_gdbarch_tdep : gdbarch_tdep_base
 {
 };
 
diff --git a/gdb/cris-tdep.h b/gdb/cris-tdep.h
index 0b1801afa04..981515a4e9f 100644
--- a/gdb/cris-tdep.h
+++ b/gdb/cris-tdep.h
@@ -26,7 +26,7 @@
 #include "gdbarch.h"
 
 /* CRIS architecture specific information.  */
-struct cris_gdbarch_tdep : gdbarch_tdep
+struct cris_gdbarch_tdep : gdbarch_tdep_base
 {
   unsigned int cris_version = 0;
   const char *cris_mode = nullptr;
diff --git a/gdb/csky-tdep.h b/gdb/csky-tdep.h
index 4cfc0a5d086..54000ab8287 100644
--- a/gdb/csky-tdep.h
+++ b/gdb/csky-tdep.h
@@ -31,7 +31,7 @@ enum lr_type_t
 };
 
 /* Target-dependent structure in gdbarch.  */
-struct csky_gdbarch_tdep : gdbarch_tdep
+struct csky_gdbarch_tdep : gdbarch_tdep_base
 {
   /* Save FPU, VDSP ABI.  */
   unsigned int fpu_abi;
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index 34f437764a9..55a6cfd9618 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -68,7 +68,7 @@ struct frv_unwind_cache		/* was struct frame_extra_info */
    of structures, each of which gives all the necessary info for one
    register.  Don't stick parallel arrays in here --- that's so
    Fortran.  */
-struct frv_gdbarch_tdep : gdbarch_tdep
+struct frv_gdbarch_tdep : gdbarch_tdep_base
 {
   /* Which ABI is in use?  */
   enum frv_abi frv_abi {};
diff --git a/gdb/ft32-tdep.h b/gdb/ft32-tdep.h
index e66a417198e..e9befaba9d4 100644
--- a/gdb/ft32-tdep.h
+++ b/gdb/ft32-tdep.h
@@ -22,7 +22,7 @@
 
 #include "gdbarch.h"
 
-struct ft32_gdbarch_tdep : gdbarch_tdep
+struct ft32_gdbarch_tdep : gdbarch_tdep_base
 {
   /* Type for a pointer to a function.  Used for the type of PC.  */
   struct type *pc_type = nullptr;
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 5d14aec1455..d4ea5d33c9c 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -43,7 +43,7 @@ struct gdbarch
   const struct target_desc * target_desc;
 
   /* target specific vector.  */
-  struct gdbarch_tdep *tdep;
+  struct gdbarch_tdep_base *tdep;
   gdbarch_dump_tdep_ftype *dump_tdep;
 
   /* per-architecture data-pointers.  */
@@ -258,7 +258,7 @@ struct gdbarch
 
 struct gdbarch *
 gdbarch_alloc (const struct gdbarch_info *info,
-	       struct gdbarch_tdep *tdep)
+	       struct gdbarch_tdep_base *tdep)
 {
   struct gdbarch *gdbarch;
 
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 16c73915c64..c439ac1dc47 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -63,9 +63,9 @@ struct inferior;
    destructor ensures the class has RTTI information, which allows
    gdb::checked_static_cast to be used, the gdbarch_tdep the function.  */
 
-struct gdbarch_tdep
+struct gdbarch_tdep_base
 {
-  virtual ~gdbarch_tdep() = default;
+  virtual ~gdbarch_tdep_base() = default;
 };
 
 /* The architecture associated with the inferior through the
@@ -153,7 +153,7 @@ using read_core_file_mappings_loop_ftype =
 /* An internal function that should _only_ be called from gdbarch_tdep.
    Returns the gdbarch_tdep field held within GDBARCH.  */
 
-extern struct gdbarch_tdep *gdbarch_tdep_1 (struct gdbarch *gdbarch);
+extern struct gdbarch_tdep_base *gdbarch_tdep_1 (struct gdbarch *gdbarch);
 
 /* Return the gdbarch_tdep object held within GDBARCH cast to the type
    TDepType, which should be a sub-class of gdbarch_tdep.  There is no
@@ -164,7 +164,7 @@ template<typename TDepType>
 static inline TDepType *
 gdbarch_tdep (struct gdbarch *gdbarch)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep_1 (gdbarch);
+  struct gdbarch_tdep_base *tdep = gdbarch_tdep_1 (gdbarch);
   return gdb::checked_static_cast<TDepType *> (tdep);
 }
 
@@ -293,7 +293,7 @@ extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *ar
    parameters.  set_gdbarch_*() functions are called to complete the
    initialization of the object.  */
 
-extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep *tdep);
+extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep_base *tdep);
 
 
 /* Helper function.  Free a partially-constructed ``struct gdbarch''.
diff --git a/gdb/gdbarch.py b/gdb/gdbarch.py
index 8956a9c38aa..bb08081af5a 100755
--- a/gdb/gdbarch.py
+++ b/gdb/gdbarch.py
@@ -267,7 +267,7 @@ with open("gdbarch.c", "w") as f:
         print(f"  {c.type} {c.name};", file=f)
     print(file=f)
     print("  /* target specific vector.  */", file=f)
-    print("  struct gdbarch_tdep *tdep;", file=f)
+    print("  struct gdbarch_tdep_base *tdep;", file=f)
     print("  gdbarch_dump_tdep_ftype *dump_tdep;", file=f)
     print(file=f)
     print("  /* per-architecture data-pointers.  */", file=f)
@@ -290,7 +290,7 @@ with open("gdbarch.c", "w") as f:
     print(file=f)
     print("struct gdbarch *", file=f)
     print("gdbarch_alloc (const struct gdbarch_info *info,", file=f)
-    print("	       struct gdbarch_tdep *tdep)", file=f)
+    print("	       struct gdbarch_tdep_base *tdep)", file=f)
     print("{", file=f)
     print("  struct gdbarch *gdbarch;", file=f)
     print("", file=f)
diff --git a/gdb/hppa-tdep.h b/gdb/hppa-tdep.h
index f1e24a272c4..c2c9e0e0b5e 100644
--- a/gdb/hppa-tdep.h
+++ b/gdb/hppa-tdep.h
@@ -84,7 +84,7 @@ enum hppa_regnum
 #define HPPA_INSN_SIZE 4
 
 /* Target-dependent structure in gdbarch.  */
-struct hppa_gdbarch_tdep : gdbarch_tdep
+struct hppa_gdbarch_tdep : gdbarch_tdep_base
 {
   /* The number of bytes in an address.  For now, this field is designed
      to allow us to differentiate hppa32 from hppa64 targets.  */
diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h
index a8067cf6b6c..cd77e0308e0 100644
--- a/gdb/i386-tdep.h
+++ b/gdb/i386-tdep.h
@@ -57,7 +57,7 @@ enum struct_return
 };
 
 /* i386 architecture specific information.  */
-struct i386_gdbarch_tdep : gdbarch_tdep
+struct i386_gdbarch_tdep : gdbarch_tdep_base
 {
   /* General-purpose registers.  */
   int *gregset_reg_offset = 0;
diff --git a/gdb/ia64-tdep.h b/gdb/ia64-tdep.h
index 675d0d871b2..f06974fd296 100644
--- a/gdb/ia64-tdep.h
+++ b/gdb/ia64-tdep.h
@@ -229,7 +229,7 @@ struct ia64_infcall_ops
   void (*set_function_addr) (struct regcache *regcache, CORE_ADDR func_addr);
 };
 
-struct ia64_gdbarch_tdep : gdbarch_tdep
+struct ia64_gdbarch_tdep : gdbarch_tdep_base
 {
   CORE_ADDR (*sigcontext_register_address) (struct gdbarch *, CORE_ADDR, int)
     = nullptr;
diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c
index 4a781c394e9..4cbff537fab 100644
--- a/gdb/lm32-tdep.c
+++ b/gdb/lm32-tdep.c
@@ -43,7 +43,7 @@
 #define LM32_REG2(insn)         ((insn >> 11) & 0x1f)
 #define LM32_IMM16(insn)        ((((long)insn & 0xffff) << 16) >> 16)
 
-struct lm32_gdbarch_tdep : gdbarch_tdep
+struct lm32_gdbarch_tdep : gdbarch_tdep_base
 {
   /* gdbarch target dependent data here.  Currently unused for LM32.  */
 };
diff --git a/gdb/loongarch-tdep.h b/gdb/loongarch-tdep.h
index e35b6cf4c7a..c5527f7d148 100644
--- a/gdb/loongarch-tdep.h
+++ b/gdb/loongarch-tdep.h
@@ -32,7 +32,7 @@ extern const struct regset loongarch_gregset;
 extern const struct regset loongarch_fpregset;
 
 /* Target-dependent structure in gdbarch.  */
-struct loongarch_gdbarch_tdep : gdbarch_tdep
+struct loongarch_gdbarch_tdep : gdbarch_tdep_base
 {
   /* Features about the abi that impact how the gdbarch is configured.  */
   struct loongarch_gdbarch_features abi_features;
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
index 37456d16cb3..30f716b6969 100644
--- a/gdb/m32c-tdep.c
+++ b/gdb/m32c-tdep.c
@@ -96,7 +96,7 @@ struct m32c_reg
 #define M32C_MAX_DWARF_REGNUM (40)
 
 
-struct m32c_gdbarch_tdep : gdbarch_tdep
+struct m32c_gdbarch_tdep : gdbarch_tdep_base
 {
   /* All the registers for this variant, indexed by GDB register
      number, and the number of registers present.  */
diff --git a/gdb/m32r-tdep.h b/gdb/m32r-tdep.h
index 1fa143adc74..09d5b245770 100644
--- a/gdb/m32r-tdep.h
+++ b/gdb/m32r-tdep.h
@@ -22,7 +22,7 @@
 
 #include "gdbarch.h"
 
-struct m32r_gdbarch_tdep : gdbarch_tdep
+struct m32r_gdbarch_tdep : gdbarch_tdep_base
 {
   /* gdbarch target dependent data here.  Currently unused for M32R.  */
 };
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index 9eb18b937be..7ea1f9a5b91 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -124,7 +124,7 @@ enum insn_return_kind {
 #define M68HC12_HARD_PC_REGNUM  (SOFT_D32_REGNUM+1)
 
 struct insn_sequence;
-struct m68gc11_gdbarch_tdep : gdbarch_tdep
+struct m68gc11_gdbarch_tdep : gdbarch_tdep_base
   {
     /* Stack pointer correction value.  For 68hc11, the stack pointer points
        to the next push location.  An offset of 1 must be applied to obtain
diff --git a/gdb/m68k-tdep.h b/gdb/m68k-tdep.h
index c70a26e8554..785e3fdb84f 100644
--- a/gdb/m68k-tdep.h
+++ b/gdb/m68k-tdep.h
@@ -69,7 +69,7 @@ enum m68k_flavour
 
 /* Target-dependent structure in gdbarch.  */
 
-struct m68k_gdbarch_tdep : gdbarch_tdep
+struct m68k_gdbarch_tdep : gdbarch_tdep_base
 {
   /* Offset to PC value in the jump buffer.  If this is negative,
      longjmp support will be disabled.  */
diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c
index d5ba78c6df9..170b4b07460 100644
--- a/gdb/mep-tdep.c
+++ b/gdb/mep-tdep.c
@@ -116,7 +116,7 @@
      options are present on the current processor.  */
 
 
-struct mep_gdbarch_tdep : gdbarch_tdep
+struct mep_gdbarch_tdep : gdbarch_tdep_base
 {
   /* A CGEN cpu descriptor for this BFD architecture and machine.
 
diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h
index 4d90e8785dc..48b2581fcc7 100644
--- a/gdb/microblaze-tdep.h
+++ b/gdb/microblaze-tdep.h
@@ -23,7 +23,7 @@
 #include "gdbarch.h"
 
 /* Microblaze architecture-specific information.  */
-struct microblaze_gdbarch_tdep : gdbarch_tdep
+struct microblaze_gdbarch_tdep : gdbarch_tdep_base
 {
 };
 
diff --git a/gdb/mips-tdep.h b/gdb/mips-tdep.h
index 4d2664d4273..24ed678a521 100644
--- a/gdb/mips-tdep.h
+++ b/gdb/mips-tdep.h
@@ -93,7 +93,7 @@ enum mips_fpu_type
 };
 
 /* MIPS specific per-architecture information.  */
-struct mips_gdbarch_tdep : gdbarch_tdep
+struct mips_gdbarch_tdep : gdbarch_tdep_base
 {
   /* from the elf header */
   int elf_flags = 0;
diff --git a/gdb/mn10300-tdep.h b/gdb/mn10300-tdep.h
index 87b861ead90..dacfb9d2948 100644
--- a/gdb/mn10300-tdep.h
+++ b/gdb/mn10300-tdep.h
@@ -76,7 +76,7 @@ enum frame_kind {
 };
 
 /* mn10300 private data.  */
-struct mn10300_gdbarch_tdep : gdbarch_tdep
+struct mn10300_gdbarch_tdep : gdbarch_tdep_base
 {
   int am33_mode;
 };
diff --git a/gdb/moxie-tdep.h b/gdb/moxie-tdep.h
index 91d007fd723..69bb5d0fa3a 100644
--- a/gdb/moxie-tdep.h
+++ b/gdb/moxie-tdep.h
@@ -22,7 +22,7 @@
 
 #include "gdbarch.h"
 
-struct moxie_gdbarch_tdep : gdbarch_tdep
+struct moxie_gdbarch_tdep : gdbarch_tdep_base
 {
   /* gdbarch target dependent data here.  Currently unused for MOXIE.  */
 };
diff --git a/gdb/msp430-tdep.c b/gdb/msp430-tdep.c
index 4ae8b3d5626..cf4106d1a34 100644
--- a/gdb/msp430-tdep.c
+++ b/gdb/msp430-tdep.c
@@ -105,7 +105,7 @@ enum
 
 /* Architecture specific data.  */
 
-struct msp430_gdbarch_tdep : gdbarch_tdep
+struct msp430_gdbarch_tdep : gdbarch_tdep_base
 {
   /* The ELF header flags specify the multilib used.  */
   int elf_flags = 0;
diff --git a/gdb/nds32-tdep.h b/gdb/nds32-tdep.h
index 2cabd6a173f..e68017b4667 100644
--- a/gdb/nds32-tdep.h
+++ b/gdb/nds32-tdep.h
@@ -42,7 +42,7 @@ enum nds32_regnum
   NDS32_FD0_REGNUM = NDS32_NUM_REGS,
 };
 
-struct nds32_gdbarch_tdep : gdbarch_tdep
+struct nds32_gdbarch_tdep : gdbarch_tdep_base
 {
   /* The guessed FPU configuration.  */
   int fpu_freg = 0;
diff --git a/gdb/nios2-tdep.h b/gdb/nios2-tdep.h
index b8913ed1baa..cbf2599f5c0 100644
--- a/gdb/nios2-tdep.h
+++ b/gdb/nios2-tdep.h
@@ -69,7 +69,7 @@
 #define NIOS2_CDX_OPCODE_SIZE 2
 
 /* Target-dependent structure in gdbarch.  */
-struct nios2_gdbarch_tdep : gdbarch_tdep
+struct nios2_gdbarch_tdep : gdbarch_tdep_base
 {
   /* Assumes FRAME is stopped at a syscall (trap) instruction; returns
      the expected next PC.  */
diff --git a/gdb/or1k-tdep.c b/gdb/or1k-tdep.c
index 4699b755d42..360a7cb36c1 100644
--- a/gdb/or1k-tdep.c
+++ b/gdb/or1k-tdep.c
@@ -63,7 +63,7 @@ show_or1k_debug (struct ui_file *file, int from_tty,
 
 /* The target-dependent structure for gdbarch.  */
 
-struct or1k_gdbarch_tdep : gdbarch_tdep
+struct or1k_gdbarch_tdep : gdbarch_tdep_base
 {
   int bytes_per_word = 0;
   int bytes_per_address = 0;
diff --git a/gdb/ppc-tdep.h b/gdb/ppc-tdep.h
index 80a7dd080a2..44f63b145c6 100644
--- a/gdb/ppc-tdep.h
+++ b/gdb/ppc-tdep.h
@@ -205,7 +205,7 @@ enum powerpc_long_double_abi
   POWERPC_LONG_DOUBLE_LAST
 };
 
-struct ppc_gdbarch_tdep : gdbarch_tdep
+struct ppc_gdbarch_tdep : gdbarch_tdep_base
   {
     int wordsize = 0;		/* Size in bytes of fixed-point word.  */
     int soft_float = 0;		/* Avoid FP registers for arguments?  */
diff --git a/gdb/riscv-tdep.h b/gdb/riscv-tdep.h
index ac4b4b7144d..826a002ef92 100644
--- a/gdb/riscv-tdep.h
+++ b/gdb/riscv-tdep.h
@@ -76,7 +76,7 @@ enum
 };
 
 /* RISC-V specific per-architecture information.  */
-struct riscv_gdbarch_tdep : gdbarch_tdep
+struct riscv_gdbarch_tdep : gdbarch_tdep_base
 {
   /* Features about the target hardware that impact how the gdbarch is
      configured.  Two gdbarch instances are compatible only if this field
diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c
index 2462e7a191d..be668bfa6fe 100644
--- a/gdb/rl78-tdep.c
+++ b/gdb/rl78-tdep.c
@@ -210,7 +210,7 @@ enum
 
 /* Architecture specific data.  */
 
-struct rl78_gdbarch_tdep : gdbarch_tdep
+struct rl78_gdbarch_tdep : gdbarch_tdep_base
 {
   /* The ELF header flags specify the multilib used.  */
   int elf_flags = 0;
diff --git a/gdb/rx-tdep.c b/gdb/rx-tdep.c
index c67d4057195..989d90096bd 100644
--- a/gdb/rx-tdep.c
+++ b/gdb/rx-tdep.c
@@ -69,7 +69,7 @@ enum rx_frame_type {
 };
 
 /* Architecture specific data.  */
-struct rx_gdbarch_tdep : gdbarch_tdep
+struct rx_gdbarch_tdep : gdbarch_tdep_base
 {
   /* The ELF header flags specify the multilib used.  */
   int elf_flags = 0;
diff --git a/gdb/s12z-tdep.c b/gdb/s12z-tdep.c
index 4e33faaea9a..5e49c615f1b 100644
--- a/gdb/s12z-tdep.c
+++ b/gdb/s12z-tdep.c
@@ -458,7 +458,7 @@ constexpr gdb_byte s12z_break_insn[] = {0x00};
 
 typedef BP_MANIPULATION (s12z_break_insn) s12z_breakpoint;
 
-struct s12z_gdbarch_tdep : gdbarch_tdep
+struct s12z_gdbarch_tdep : gdbarch_tdep_base
 {
 };
 
diff --git a/gdb/s390-tdep.h b/gdb/s390-tdep.h
index ac08da1c7c8..f51423cb018 100644
--- a/gdb/s390-tdep.h
+++ b/gdb/s390-tdep.h
@@ -38,7 +38,7 @@ enum s390_vector_abi_kind
 
 /* The tdep structure.  */
 
-struct s390_gdbarch_tdep : gdbarch_tdep
+struct s390_gdbarch_tdep : gdbarch_tdep_base
 {
   /* Target description.  */
   const struct target_desc *tdesc = nullptr;
diff --git a/gdb/sh-tdep.h b/gdb/sh-tdep.h
index bc0383fb075..54aa7ff828f 100644
--- a/gdb/sh-tdep.h
+++ b/gdb/sh-tdep.h
@@ -91,7 +91,7 @@ struct sh_corefile_regmap
   unsigned int offset;
 };
 
-struct sh_gdbarch_tdep : gdbarch_tdep
+struct sh_gdbarch_tdep : gdbarch_tdep_base
 {
   /* Non-NULL when debugging from a core file.  Provides the offset
      where each general-purpose register is stored inside the associated
diff --git a/gdb/sparc-tdep.h b/gdb/sparc-tdep.h
index 36ff5349a0a..f2070f10e12 100644
--- a/gdb/sparc-tdep.h
+++ b/gdb/sparc-tdep.h
@@ -57,7 +57,7 @@ struct sparc_fpregmap
 
 /* SPARC architecture-specific information.  */
 
-struct sparc_gdbarch_tdep : gdbarch_tdep
+struct sparc_gdbarch_tdep : gdbarch_tdep_base
 {
   /* Register numbers for the PN and nPC registers.  The definitions
      for (64-bit) UltraSPARC differ from the (32-bit) SPARC
diff --git a/gdb/tic6x-tdep.h b/gdb/tic6x-tdep.h
index d9b9644f8df..ebfd6e686fa 100644
--- a/gdb/tic6x-tdep.h
+++ b/gdb/tic6x-tdep.h
@@ -46,7 +46,7 @@ extern const gdb_byte tic6x_bkpt_illegal_opcode_be[];
 extern const gdb_byte tic6x_bkpt_illegal_opcode_le[];
 
 /* Target-dependent structure in gdbarch.  */
-struct tic6x_gdbarch_tdep : gdbarch_tdep
+struct tic6x_gdbarch_tdep : gdbarch_tdep_base
 {
   /* Return the expected next PC if FRAME is stopped at a syscall
      instruction.  */
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index 4de5faa6a47..f7094e37a92 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -265,7 +265,7 @@ enum v850_abi
 
 /* Architecture specific data.  */
 
-struct v850_gdbarch_tdep : gdbarch_tdep
+struct v850_gdbarch_tdep : gdbarch_tdep_base
 {
   /* Fields from the ELF header.  */
   int e_flags = 0;
diff --git a/gdb/xtensa-tdep.h b/gdb/xtensa-tdep.h
index 1840ef98b49..da7a7080afd 100644
--- a/gdb/xtensa-tdep.h
+++ b/gdb/xtensa-tdep.h
@@ -167,7 +167,7 @@ struct ctype_cache
 
 /*  Xtensa-specific target dependencies.  */
 
-struct xtensa_gdbarch_tdep : gdbarch_tdep
+struct xtensa_gdbarch_tdep : gdbarch_tdep_base
 {
   xtensa_gdbarch_tdep (xtensa_register_t *regmap)
     : regmap (regmap)
diff --git a/gdb/z80-tdep.c b/gdb/z80-tdep.c
index 6a11883e7b4..1ab375c5014 100644
--- a/gdb/z80-tdep.c
+++ b/gdb/z80-tdep.c
@@ -55,7 +55,7 @@
      next frame - frame of caller, which has called current function
 */
 
-struct z80_gdbarch_tdep : gdbarch_tdep
+struct z80_gdbarch_tdep : gdbarch_tdep_base
 {
   /* Number of bytes used for address:
       2 bytes for all Z80 family


  reply	other threads:[~2022-07-25 11:19 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-31 14:30 [PATCH 0/5] Handle trying to use a native target with the wrong binary Andrew Burgess
2022-05-31 14:30 ` [PATCH 1/5] gdb/arm: move fetch of arm_gdbarch_tdep to a more inner scope Andrew Burgess
2022-06-01  7:58   ` Luis Machado
2022-05-31 14:30 ` [PATCH 2/5] gdb/mips: rewrite show_mask_address Andrew Burgess
2022-05-31 14:30 ` [PATCH 3/5] gdb: move the type cast into gdbarch_tdep Andrew Burgess
2022-06-01  8:01   ` Luis Machado
2022-05-31 14:30 ` [PATCH 4/5] gdb: ensure the cast in gdbarch_tdep is valid Andrew Burgess
2022-05-31 16:04   ` John Baldwin
2022-05-31 17:22     ` Andrew Burgess
2022-05-31 14:30 ` [PATCH 5/5] gdb: native target invalid architecture detection Andrew Burgess
2022-05-31 16:08   ` John Baldwin
2022-05-31 16:51     ` Andrew Burgess
2022-06-01  8:25       ` Luis Machado
2022-06-01 21:06         ` John Baldwin
2022-06-01 21:21           ` Christophe Lyon
2022-06-02 14:56             ` John Baldwin
2022-06-06 14:38         ` Andrew Burgess
2022-06-06 17:48           ` Andrew Burgess
2022-06-07 11:03             ` Luis Machado
2022-06-07 18:42               ` Pedro Alves
2022-06-07 20:15                 ` Pedro Alves
2022-06-08  8:18                   ` Luis Machado
2022-06-08 10:17                     ` Pedro Alves
2022-06-08  7:54                 ` Luis Machado
2022-06-08 10:12                   ` Pedro Alves
2022-06-08 11:20                     ` [PATCH v2] aarch64: Add fallback if ARM_CC_FOR_TARGET not set (was: Re: [PATCH 5/5] gdb: native target invalid architecture detection) Pedro Alves
2022-06-08 12:50                       ` Luis Machado
2022-06-08 13:23                         ` Pedro Alves
2022-06-08 13:38                       ` Andrew Burgess
2022-06-08 19:01                       ` John Baldwin
2022-06-08 21:48                         ` Pedro Alves
2022-06-09 16:31                           ` John Baldwin
2022-06-10 13:08 ` [PATCHv2 0/6] Handle trying to use a native target with the wrong binary Andrew Burgess
2022-06-10 13:08   ` [PATCHv2 1/6] gdb/arm: move fetch of arm_gdbarch_tdep to a more inner scope Andrew Burgess
2022-06-10 13:08   ` [PATCHv2 2/6] gdb/mips: rewrite show_mask_address Andrew Burgess
2022-06-10 13:08   ` [PATCHv2 3/6] gdb/arm: avoid undefined behaviour in arm_frame_is_thumb Andrew Burgess
2022-06-10 15:21     ` Luis Machado
2022-06-10 15:49       ` Andrew Burgess
2022-06-10 16:29         ` Luis Machado
2022-06-10 13:08   ` [PATCHv2 4/6] gdb: move the type cast into gdbarch_tdep Andrew Burgess
2022-06-10 16:35     ` Luis Machado
2022-06-10 13:08   ` [PATCHv2 5/6] gdb: ensure the cast in gdbarch_tdep is valid Andrew Burgess
2022-06-10 13:08   ` [PATCHv2 6/6] gdb: native target invalid architecture detection Andrew Burgess
2022-06-10 16:20     ` John Baldwin
2022-06-10 16:31     ` Luis Machado
2022-06-13 16:15   ` [PATCHv3 0/6] Handle trying to use a native target with the wrong binary Andrew Burgess
2022-06-13 16:15     ` [PATCHv3 1/6] gdb/arm: move fetch of arm_gdbarch_tdep to a more inner scope Andrew Burgess
2022-06-13 16:15     ` [PATCHv3 2/6] gdb/mips: rewrite show_mask_address Andrew Burgess
2022-06-13 16:15     ` [PATCHv3 3/6] gdb: select suitable thread for gdbarch_adjust_breakpoint_address Andrew Burgess
2022-06-14  9:45       ` Luis Machado
2022-06-14 14:05         ` Andrew Burgess
2022-06-24 16:58       ` Pedro Alves
2022-06-13 16:15     ` [PATCHv3 4/6] gdb: move the type cast into gdbarch_tdep Andrew Burgess
2022-06-13 16:15     ` [PATCHv3 5/6] gdb: ensure the cast in gdbarch_tdep is valid Andrew Burgess
2022-06-24 18:15       ` Pedro Alves
2022-06-13 16:15     ` [PATCHv3 6/6] gdb: native target invalid architecture detection Andrew Burgess
2022-06-24 19:23       ` Pedro Alves
2022-06-27 16:27         ` Andrew Burgess
2022-06-27 21:38           ` Pedro Alves
2022-06-28 10:37             ` Andrew Burgess
2022-06-28 12:42               ` [PATCH v2] gdb+gdbserver/Linux: avoid reading registers while going through shell (was: Re: [PATCHv3 6/6] gdb: native target invalid architecture detection) Pedro Alves
2022-06-28 14:21                 ` Andrew Burgess
2022-06-29 15:17                 ` Simon Marchi
2022-06-29 16:22                   ` [PATCH] Fix GDBserver regression due to change to avoid reading shell registers Pedro Alves
2022-06-29 16:38                     ` Simon Marchi
2022-06-30  9:33             ` [PATCHv3 6/6] gdb: native target invalid architecture detection Andrew Burgess
2022-06-30 11:44               ` Pedro Alves
2022-07-11 10:47                 ` Andrew Burgess
2022-06-24 10:15     ` [PATCHv3 0/6] Handle trying to use a native target with the wrong binary Andrew Burgess
2022-06-28 14:28     ` [PATCHv4 0/6] Detect invalid casts of gdbarch_tdep structures Andrew Burgess
2022-06-28 14:28       ` [PATCHv4 1/6] gdb/arm: move fetch of arm_gdbarch_tdep to a more inner scope Andrew Burgess
2022-06-28 14:28       ` [PATCHv4 2/6] gdb/mips: rewrite show_mask_address Andrew Burgess
2022-06-28 14:28       ` [PATCHv4 3/6] gdb: select suitable thread for gdbarch_adjust_breakpoint_address Andrew Burgess
2022-06-28 14:28       ` [PATCHv4 4/6] gdb: move the type cast into gdbarch_tdep Andrew Burgess
2022-06-28 14:28       ` [PATCHv4 5/6] gdbsupport: add checked_static_cast Andrew Burgess
2022-06-28 14:28       ` [PATCHv4 6/6] gdb: ensure the cast in gdbarch_tdep is valid Andrew Burgess
2022-07-11 10:46       ` [PATCHv4 0/6] Detect invalid casts of gdbarch_tdep structures Andrew Burgess
2022-07-21 18:21         ` Andrew Burgess
2022-07-22  0:50           ` Luis Machado
2022-07-23  0:02             ` [PATCH] Rename gdbarch_tdep template function to gdbarch_tdep_cast for g++ 4.8 Mark Wielaard
2022-07-25 11:19               ` Andrew Burgess [this message]
2022-07-25 11:27                 ` Mark Wielaard
2022-07-26 11:05                   ` Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fsipa18p.fsf@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark@klomp.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).