public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] gdbserver/linux-low: turn 'arch_setup' into a method
Date: Fri, 17 Apr 2020 08:38:38 -0400	[thread overview]
Message-ID: <797bcff595c5e161b333077299fcaca19bb4fd17@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 797bcff595c5e161b333077299fcaca19bb4fd17 ***

commit 797bcff595c5e161b333077299fcaca19bb4fd17
Author:     Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
AuthorDate: Thu Apr 2 15:11:23 2020 +0200
Commit:     Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
CommitDate: Thu Apr 2 15:11:23 2020 +0200

    gdbserver/linux-low: turn 'arch_setup' into a method
    
    gdbserver/ChangeLog:
    2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
    
            Turn the 'arch_setup' linux target op into a method of
            linux_process_target.
    
            * linux-low.h (struct linux_target_ops) <arch_setup>: Delete.
            (class linux_process_target) <arch_setup_thread>
            <low_arch_setup>: New declarations.
            * linux-low.cc (linux_arch_setup): Delete.
            (linux_arch_setup_thread): Turn into...
            (linux_process_target::arch_setup_thread): ... this.
    
            Update the callers below.
    
            (linux_process_target::handle_extended_wait)
            (linux_process_target::post_create_inferior)
            (linux_process_target::filter_event)
    
            * linux-x86-low.cc (class x86_target) <low_arch_setup>: New
            declaration.
            (x86_linux_update_xmltarget): Turn into...
            (x86_target::update_xmltarget): ...this.
            (x86_linux_process_qsupported): Update the call to
            x86_linux_update_xmltarget.
            (x86_arch_setup): Turn into ...
            (x86_target::low_arch_setup): ...this.
            (the_low_target): Remove the op field.
            * linux-aarch64-low.cc (class aarch64_target) <low_arch_setup>: New
            declaration.
            (aarch64_arch_setup): Turn into ...
            (aarch64_target::low_arch_setup): ...this.
            (the_low_target): Remove the op field.
            * linux-arm-low.cc (class arm_target) <low_arch_setup>: New
            declaration.
            (arm_arch_setup): Turn into ...
            (arm_target::low_arch_setup): ...this.
            (the_low_target): Remove the op field.
            * linux-bfin-low.cc (class bfin_target) <low_arch_setup>: New
            declaration.
            (bfin_arch_setup): Turn into ...
            (bfin_target::low_arch_setup): ...this.
            (the_low_target): Remove the op field.
            * linux-cris-low.cc (class cris_target) <low_arch_setup>: New
            declaration.
            (cris_arch_setup): Turn into ...
            (cris_target::low_arch_setup): ...this.
            (the_low_target): Remove the op field.
            * linux-crisv32-low.cc (class crisv32_target) <low_arch_setup>: New
            declaration.
            (crisv32_arch_setup): Turn into ...
            (crisv32_target::low_arch_setup): ...this.
            (the_low_target): Remove the op field.
            * linux-ia64-low.cc (class ia64_target) <low_arch_setup>: New
            declaration.
            (ia64_arch_setup): Turn into ...
            (ia64_target::low_arch_setup): ...this.
            (the_low_target): Remove the op field.
            * linux-m32r-low.cc (class m32r_target) <low_arch_setup>: New
            declaration.
            (m32r_arch_setup): Turn into ...
            (m32r_target::low_arch_setup): ...this.
            (the_low_target): Remove the op field.
            * linux-m68k-low.cc (class m68k_target) <low_arch_setup>: New
            declaration.
            (m68k_arch_setup): Turn into ...
            (m68k_target::low_arch_setup): ...this.
            (the_low_target): Remove the op field.
            * linux-mips-low.cc (class mips_target) <low_arch_setup>: New
            declaration.
            (mips_arch_setup): Turn into ...
            (mips_target::low_arch_setup): ...this.
            (the_low_target): Remove the op field.
            * linux-nios2-low.cc (class nios2_target) <low_arch_setup>: New
            declaration.
            (nios2_arch_setup): Turn into ...
            (nios2_target::low_arch_setup): ...this.
            (the_low_target): Remove the op field.
            * linux-ppc-low.cc (class ppc_target) <low_arch_setup>: New
            declaration.
            (ppc_arch_setup): Turn into ...
            (ppc_target::low_arch_setup): ...this.
            (the_low_target): Remove the op field.
            * linux-riscv-low.cc (class riscv_target) <low_arch_setup>: New
            declaration.
            (riscv_arch_setup): Turn into ...
            (riscv_target::low_arch_setup): ...this.
            (the_low_target): Remove the op field.
            * linux-s390-low.cc (class s390_target) <low_arch_setup>: New
            declaration.
            (s390_arch_setup): Turn into ...
            (s390_target::low_arch_setup): ...this.
            (the_low_target): Remove the op field.
            * linux-sh-low.cc (class sh_target) <low_arch_setup>: New
            declaration.
            (sh_arch_setup): Turn into ...
            (sh_target::low_arch_setup): ...this.
            (the_low_target): Remove the op field.
            * linux-sparc-low.cc (class sparc_target) <low_arch_setup>: New
            declaration.
            (sparc_arch_setup): Turn into ...
            (sparc_target::low_arch_setup): ...this.
            (the_low_target): Remove the op field.
            * linux-tic6x-low.cc (class tic6x_target) <low_arch_setup>: New
            declaration.
            (tic6x_arch_setup): Turn into ...
            (tic6x_target::low_arch_setup): ...this.
            (the_low_target): Remove the op field.
            * linux-tile-low.cc (class tile_target) <low_arch_setup>: New
            declaration.
            (tile_arch_setup): Turn into ...
            (tile_target::low_arch_setup): ...this.
            (the_low_target): Remove the op field.
            * linux-xtensa-low.cc (class xtensa_target) <low_arch_setup>: New
            declaration.
            (xtensa_arch_setup): Turn into ...
            (xtensa_target::low_arch_setup): ...this.
            (the_low_target): Remove the op field.

diff --git a/gdbserver/ChangeLog b/gdbserver/ChangeLog
index b55589fcde..4a9d7bc3e4 100644
--- a/gdbserver/ChangeLog
+++ b/gdbserver/ChangeLog
@@ -1,3 +1,121 @@
+2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
+
+	Turn the 'arch_setup' linux target op into a method of
+	linux_process_target.
+
+	* linux-low.h (struct linux_target_ops) <arch_setup>: Delete.
+	(class linux_process_target) <arch_setup_thread>
+	<low_arch_setup>: New declarations.
+	* linux-low.cc (linux_arch_setup): Delete.
+	(linux_arch_setup_thread): Turn into...
+	(linux_process_target::arch_setup_thread): ... this.
+
+	Update the callers below.
+
+	(linux_process_target::handle_extended_wait)
+	(linux_process_target::post_create_inferior)
+	(linux_process_target::filter_event)
+
+	* linux-x86-low.cc (class x86_target) <low_arch_setup>: New
+	declaration.
+	(x86_linux_update_xmltarget): Turn into...
+	(x86_target::update_xmltarget): ...this.
+	(x86_linux_process_qsupported): Update the call to
+	x86_linux_update_xmltarget.
+	(x86_arch_setup): Turn into ...
+	(x86_target::low_arch_setup): ...this.
+	(the_low_target): Remove the op field.
+	* linux-aarch64-low.cc (class aarch64_target) <low_arch_setup>: New
+	declaration.
+	(aarch64_arch_setup): Turn into ...
+	(aarch64_target::low_arch_setup): ...this.
+	(the_low_target): Remove the op field.
+	* linux-arm-low.cc (class arm_target) <low_arch_setup>: New
+	declaration.
+	(arm_arch_setup): Turn into ...
+	(arm_target::low_arch_setup): ...this.
+	(the_low_target): Remove the op field.
+	* linux-bfin-low.cc (class bfin_target) <low_arch_setup>: New
+	declaration.
+	(bfin_arch_setup): Turn into ...
+	(bfin_target::low_arch_setup): ...this.
+	(the_low_target): Remove the op field.
+	* linux-cris-low.cc (class cris_target) <low_arch_setup>: New
+	declaration.
+	(cris_arch_setup): Turn into ...
+	(cris_target::low_arch_setup): ...this.
+	(the_low_target): Remove the op field.
+	* linux-crisv32-low.cc (class crisv32_target) <low_arch_setup>: New
+	declaration.
+	(crisv32_arch_setup): Turn into ...
+	(crisv32_target::low_arch_setup): ...this.
+	(the_low_target): Remove the op field.
+	* linux-ia64-low.cc (class ia64_target) <low_arch_setup>: New
+	declaration.
+	(ia64_arch_setup): Turn into ...
+	(ia64_target::low_arch_setup): ...this.
+	(the_low_target): Remove the op field.
+	* linux-m32r-low.cc (class m32r_target) <low_arch_setup>: New
+	declaration.
+	(m32r_arch_setup): Turn into ...
+	(m32r_target::low_arch_setup): ...this.
+	(the_low_target): Remove the op field.
+	* linux-m68k-low.cc (class m68k_target) <low_arch_setup>: New
+	declaration.
+	(m68k_arch_setup): Turn into ...
+	(m68k_target::low_arch_setup): ...this.
+	(the_low_target): Remove the op field.
+	* linux-mips-low.cc (class mips_target) <low_arch_setup>: New
+	declaration.
+	(mips_arch_setup): Turn into ...
+	(mips_target::low_arch_setup): ...this.
+	(the_low_target): Remove the op field.
+	* linux-nios2-low.cc (class nios2_target) <low_arch_setup>: New
+	declaration.
+	(nios2_arch_setup): Turn into ...
+	(nios2_target::low_arch_setup): ...this.
+	(the_low_target): Remove the op field.
+	* linux-ppc-low.cc (class ppc_target) <low_arch_setup>: New
+	declaration.
+	(ppc_arch_setup): Turn into ...
+	(ppc_target::low_arch_setup): ...this.
+	(the_low_target): Remove the op field.
+	* linux-riscv-low.cc (class riscv_target) <low_arch_setup>: New
+	declaration.
+	(riscv_arch_setup): Turn into ...
+	(riscv_target::low_arch_setup): ...this.
+	(the_low_target): Remove the op field.
+	* linux-s390-low.cc (class s390_target) <low_arch_setup>: New
+	declaration.
+	(s390_arch_setup): Turn into ...
+	(s390_target::low_arch_setup): ...this.
+	(the_low_target): Remove the op field.
+	* linux-sh-low.cc (class sh_target) <low_arch_setup>: New
+	declaration.
+	(sh_arch_setup): Turn into ...
+	(sh_target::low_arch_setup): ...this.
+	(the_low_target): Remove the op field.
+	* linux-sparc-low.cc (class sparc_target) <low_arch_setup>: New
+	declaration.
+	(sparc_arch_setup): Turn into ...
+	(sparc_target::low_arch_setup): ...this.
+	(the_low_target): Remove the op field.
+	* linux-tic6x-low.cc (class tic6x_target) <low_arch_setup>: New
+	declaration.
+	(tic6x_arch_setup): Turn into ...
+	(tic6x_target::low_arch_setup): ...this.
+	(the_low_target): Remove the op field.
+	* linux-tile-low.cc (class tile_target) <low_arch_setup>: New
+	declaration.
+	(tile_arch_setup): Turn into ...
+	(tile_target::low_arch_setup): ...this.
+	(the_low_target): Remove the op field.
+	* linux-xtensa-low.cc (class xtensa_target) <low_arch_setup>: New
+	declaration.
+	(xtensa_arch_setup): Turn into ...
+	(xtensa_target::low_arch_setup): ...this.
+	(the_low_target): Remove the op field.
+
 2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
 
 	* linux-low.h (the_linux_target): New extern declaration.
diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc
index 102b61ef9c..44f729386c 100644
--- a/gdbserver/linux-aarch64-low.cc
+++ b/gdbserver/linux-aarch64-low.cc
@@ -55,6 +55,9 @@ class aarch64_target : public linux_process_target
 {
 public:
 
+protected:
+
+  void low_arch_setup () override;
 };
 
 /* The singleton target ops object.  */
@@ -515,10 +518,10 @@ aarch64_linux_new_fork (struct process_info *parent,
 /* Matches HWCAP_PACA in kernel header arch/arm64/include/uapi/asm/hwcap.h.  */
 #define AARCH64_HWCAP_PACA (1 << 30)
 
-/* Implementation of linux_target_ops method "arch_setup".  */
+/* Implementation of linux target ops method "low_arch_setup".  */
 
-static void
-aarch64_arch_setup (void)
+void
+aarch64_target::low_arch_setup ()
 {
   unsigned int machine;
   int is_elf64;
@@ -3062,7 +3065,6 @@ aarch64_supports_hardware_single_step (void)
 
 struct linux_target_ops the_low_target =
 {
-  aarch64_arch_setup,
   aarch64_regs_info,
   NULL, /* cannot_fetch_register */
   NULL, /* cannot_store_register */
diff --git a/gdbserver/linux-arm-low.cc b/gdbserver/linux-arm-low.cc
index 7ecedb8f6e..17f9549a88 100644
--- a/gdbserver/linux-arm-low.cc
+++ b/gdbserver/linux-arm-low.cc
@@ -60,6 +60,9 @@ class arm_target : public linux_process_target
 {
 public:
 
+protected:
+
+  void low_arch_setup () override;
 };
 
 /* The singleton target ops object.  */
@@ -889,8 +892,8 @@ arm_read_description (void)
   return arm_linux_read_description (ARM_FP_TYPE_NONE);
 }
 
-static void
-arm_arch_setup (void)
+void
+arm_target::low_arch_setup ()
 {
   int tid = lwpid_of (current_thread);
   int gpregs[18];
@@ -1018,7 +1021,6 @@ arm_regs_info (void)
 }
 
 struct linux_target_ops the_low_target = {
-  arm_arch_setup,
   arm_regs_info,
   arm_cannot_fetch_register,
   arm_cannot_store_register,
diff --git a/gdbserver/linux-bfin-low.cc b/gdbserver/linux-bfin-low.cc
index c8c238abca..8656b20a93 100644
--- a/gdbserver/linux-bfin-low.cc
+++ b/gdbserver/linux-bfin-low.cc
@@ -29,6 +29,9 @@ class bfin_target : public linux_process_target
 {
 public:
 
+protected:
+
+  void low_arch_setup () override;
 };
 
 /* The singleton target ops object.  */
@@ -93,8 +96,8 @@ bfin_breakpoint_at (CORE_ADDR where)
   return 0;
 }
 
-static void
-bfin_arch_setup (void)
+void
+bfin_target::low_arch_setup ()
 {
   current_process ()->tdesc = tdesc_bfin;
 }
@@ -126,7 +129,6 @@ bfin_regs_info (void)
 }
 
 struct linux_target_ops the_low_target = {
-  bfin_arch_setup,
   bfin_regs_info,
   bfin_cannot_fetch_register,
   bfin_cannot_store_register,
diff --git a/gdbserver/linux-cris-low.cc b/gdbserver/linux-cris-low.cc
index d2735b4f45..ea9dbda10e 100644
--- a/gdbserver/linux-cris-low.cc
+++ b/gdbserver/linux-cris-low.cc
@@ -26,6 +26,9 @@ class cris_target : public linux_process_target
 {
 public:
 
+protected:
+
+  void low_arch_setup () override;
 };
 
 /* The singleton target ops object.  */
@@ -98,8 +101,8 @@ cris_breakpoint_at (CORE_ADDR where)
   return 0;
 }
 
-static void
-cris_arch_setup (void)
+void
+cris_target::low_arch_setup ()
 {
   current_process ()->tdesc = tdesc_cris;
 }
@@ -123,7 +126,6 @@ cris_regs_info (void)
 }
 
 struct linux_target_ops the_low_target = {
-  cris_arch_setup,
   cris_regs_info,
   cris_cannot_fetch_register,
   cris_cannot_store_register,
diff --git a/gdbserver/linux-crisv32-low.cc b/gdbserver/linux-crisv32-low.cc
index 346e2a4219..f57be1c152 100644
--- a/gdbserver/linux-crisv32-low.cc
+++ b/gdbserver/linux-crisv32-low.cc
@@ -26,6 +26,9 @@ class crisv32_target : public linux_process_target
 {
 public:
 
+protected:
+
+  void low_arch_setup () override;
 };
 
 /* The singleton target ops object.  */
@@ -358,8 +361,8 @@ cris_store_gregset (struct regcache *regcache, const void *buf)
     }
 }
 
-static void
-cris_arch_setup (void)
+void
+crisv32_target::low_arch_setup ()
 {
   current_process ()->tdesc = tdesc_crisv32;
 }
@@ -406,7 +409,6 @@ cris_regs_info (void)
 }
 
 struct linux_target_ops the_low_target = {
-  cris_arch_setup,
   cris_regs_info,
   NULL,
   NULL,
diff --git a/gdbserver/linux-ia64-low.cc b/gdbserver/linux-ia64-low.cc
index 169a567d67..bccab15dcc 100644
--- a/gdbserver/linux-ia64-low.cc
+++ b/gdbserver/linux-ia64-low.cc
@@ -29,6 +29,9 @@ class ia64_target : public linux_process_target
 {
 public:
 
+protected:
+
+  void low_arch_setup () override;
 };
 
 /* The singleton target ops object.  */
@@ -350,15 +353,14 @@ ia64_regs_info (void)
   return &regs_info;
 }
 
-static void
-ia64_arch_setup (void)
+void
+ia64_target::low_arch_setup ()
 {
   current_process ()->tdesc = tdesc_ia64;
 }
 
 
 struct linux_target_ops the_low_target = {
-  ia64_arch_setup,
   ia64_regs_info,
   ia64_cannot_fetch_register,
   ia64_cannot_store_register,
diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc
index d399ea5c3d..5553337144 100644
--- a/gdbserver/linux-low.cc
+++ b/gdbserver/linux-low.cc
@@ -440,25 +440,15 @@ linux_add_process (int pid, int attached)
 
 static CORE_ADDR get_pc (struct lwp_info *lwp);
 
-/* Call the target arch_setup function on the current thread.  */
-
-static void
-linux_arch_setup (void)
-{
-  the_low_target.arch_setup ();
-}
-
-/* Call the target arch_setup function on THREAD.  */
-
-static void
-linux_arch_setup_thread (struct thread_info *thread)
+void
+linux_process_target::arch_setup_thread (thread_info *thread)
 {
   struct thread_info *saved_thread;
 
   saved_thread = current_thread;
   current_thread = thread;
 
-  linux_arch_setup ();
+  low_arch_setup ();
 
   current_thread = saved_thread;
 }
@@ -706,7 +696,7 @@ linux_process_target::handle_extended_wait (lwp_info **orig_event_lwp,
       event_lwp = add_lwp (event_ptid);
       event_thr = get_lwp_thread (event_lwp);
       gdb_assert (current_thread == event_thr);
-      linux_arch_setup_thread (event_thr);
+      arch_setup_thread (event_thr);
 
       /* Set the event status.  */
       event_lwp->waitstatus.kind = TARGET_WAITKIND_EXECD;
@@ -1025,7 +1015,7 @@ linux_process_target::post_create_inferior ()
 {
   struct lwp_info *lwp = get_thread_lwp (current_thread);
 
-  linux_arch_setup ();
+  low_arch_setup ();
 
   if (lwp->must_set_ptrace_flags)
     {
@@ -2433,7 +2423,7 @@ linux_process_target::filter_event (int lwpid, int wstat)
 	      /* This needs to happen after we have attached to the
 		 inferior and it is stopped for the first time, but
 		 before we access any inferior registers.  */
-	      linux_arch_setup_thread (thread);
+	      arch_setup_thread (thread);
 	    }
 	  else
 	    {
diff --git a/gdbserver/linux-low.h b/gdbserver/linux-low.h
index 0af3c3cc38..26dc831f87 100644
--- a/gdbserver/linux-low.h
+++ b/gdbserver/linux-low.h
@@ -131,9 +131,6 @@ struct lwp_info;
 
 struct linux_target_ops
 {
-  /* Architecture-specific setup.  */
-  void (*arch_setup) (void);
-
   const struct regs_info *(*regs_info) (void);
 
   /* Return 0 if we can fetch/store the register, 1 if we cannot
@@ -564,8 +561,14 @@ private:
   /* Move THREAD out of the jump pad.  */
   void move_out_of_jump_pad (thread_info *thread);
 
+  /* Call low_arch_setup on THREAD.  */
+  void arch_setup_thread (thread_info *thread);
+
 protected:
   /* The architecture-specific "low" methods are listed below.  */
+
+  /* Architecture-specific setup for the current thread.  */
+  virtual void low_arch_setup () = 0;
 };
 
 extern linux_process_target *the_linux_target;
diff --git a/gdbserver/linux-m32r-low.cc b/gdbserver/linux-m32r-low.cc
index 3921d450e0..5186cc5bdc 100644
--- a/gdbserver/linux-m32r-low.cc
+++ b/gdbserver/linux-m32r-low.cc
@@ -29,6 +29,9 @@ class m32r_target : public linux_process_target
 {
 public:
 
+protected:
+
+  void low_arch_setup () override;
 };
 
 /* The singleton target ops object.  */
@@ -92,8 +95,8 @@ m32r_breakpoint_at (CORE_ADDR where)
   return 0;
 }
 
-static void
-m32r_arch_setup (void)
+void
+m32r_target::low_arch_setup ()
 {
   current_process ()->tdesc = tdesc_m32r;
 }
@@ -125,7 +128,6 @@ m32r_regs_info (void)
 }
 
 struct linux_target_ops the_low_target = {
-  m32r_arch_setup,
   m32r_regs_info,
   m32r_cannot_fetch_register,
   m32r_cannot_store_register,
diff --git a/gdbserver/linux-m68k-low.cc b/gdbserver/linux-m68k-low.cc
index 21bd5334a2..667ca2ec15 100644
--- a/gdbserver/linux-m68k-low.cc
+++ b/gdbserver/linux-m68k-low.cc
@@ -25,6 +25,9 @@ class m68k_target : public linux_process_target
 {
 public:
 
+protected:
+
+  void low_arch_setup () override;
 };
 
 /* The singleton target ops object.  */
@@ -205,8 +208,8 @@ m68k_regs_info (void)
   return &regs_info;
 }
 
-static void
-m68k_arch_setup (void)
+void
+m68k_target::low_arch_setup ()
 {
   current_process ()->tdesc = tdesc_m68k;
 }
@@ -220,7 +223,6 @@ m68k_supports_hardware_single_step (void)
 }
 
 struct linux_target_ops the_low_target = {
-  m68k_arch_setup,
   m68k_regs_info,
   m68k_cannot_fetch_register,
   m68k_cannot_store_register,
diff --git a/gdbserver/linux-mips-low.cc b/gdbserver/linux-mips-low.cc
index debe115ea7..53a9d75e9e 100644
--- a/gdbserver/linux-mips-low.cc
+++ b/gdbserver/linux-mips-low.cc
@@ -31,6 +31,9 @@ class mips_target : public linux_process_target
 {
 public:
 
+protected:
+
+  void low_arch_setup () override;
 };
 
 /* The singleton target ops object.  */
@@ -159,8 +162,8 @@ mips_read_description (void)
   return have_dsp ? tdesc_mips_dsp_linux : tdesc_mips_linux;
 }
 
-static void
-mips_arch_setup (void)
+void
+mips_target::low_arch_setup ()
 {
   current_process ()->tdesc = mips_read_description ();
 }
@@ -949,7 +952,6 @@ mips_regs_info (void)
 }
 
 struct linux_target_ops the_low_target = {
-  mips_arch_setup,
   mips_regs_info,
   mips_cannot_fetch_register,
   mips_cannot_store_register,
diff --git a/gdbserver/linux-nios2-low.cc b/gdbserver/linux-nios2-low.cc
index 09f8778f29..1b68091654 100644
--- a/gdbserver/linux-nios2-low.cc
+++ b/gdbserver/linux-nios2-low.cc
@@ -37,6 +37,9 @@ class nios2_target : public linux_process_target
 {
 public:
 
+protected:
+
+  void low_arch_setup () override;
 };
 
 /* The singleton target ops object.  */
@@ -77,10 +80,10 @@ static int nios2_regmap[] = {
   0
 };
 
-/* Implement the arch_setup linux_target_ops method.  */
+/* Implement the low_arch_setup linux target ops method.  */
 
-static void
-nios2_arch_setup (void)
+void
+nios2_target::low_arch_setup ()
 {
   current_process ()->tdesc = tdesc_nios2_linux;
 }
@@ -248,7 +251,6 @@ nios2_regs_info (void)
 
 struct linux_target_ops the_low_target =
 {
-  nios2_arch_setup,
   nios2_regs_info,
   nios2_cannot_fetch_register,
   nios2_cannot_store_register,
diff --git a/gdbserver/linux-ppc-low.cc b/gdbserver/linux-ppc-low.cc
index a0f1ba0993..fbd6883084 100644
--- a/gdbserver/linux-ppc-low.cc
+++ b/gdbserver/linux-ppc-low.cc
@@ -50,6 +50,9 @@ class ppc_target : public linux_process_target
 {
 public:
 
+protected:
+
+  void low_arch_setup () override;
 };
 
 /* The singleton target ops object.  */
@@ -816,8 +819,8 @@ ppc_regs_info (void)
   return &regs_info;
 }
 
-static void
-ppc_arch_setup (void)
+void
+ppc_target::low_arch_setup ()
 {
   const struct target_desc *tdesc;
   struct regset_info *regset;
@@ -3383,7 +3386,6 @@ ppc_get_ipa_tdesc_idx (void)
 }
 
 struct linux_target_ops the_low_target = {
-  ppc_arch_setup,
   ppc_regs_info,
   ppc_cannot_fetch_register,
   ppc_cannot_store_register,
diff --git a/gdbserver/linux-riscv-low.cc b/gdbserver/linux-riscv-low.cc
index 04f3a99f46..4a9cefed7b 100644
--- a/gdbserver/linux-riscv-low.cc
+++ b/gdbserver/linux-riscv-low.cc
@@ -36,16 +36,19 @@ class riscv_target : public linux_process_target
 {
 public:
 
+protected:
+
+  void low_arch_setup () override;
 };
 
 /* The singleton target ops object.  */
 
 static riscv_target the_riscv_target;
 
-/* Implementation of linux_target_ops method "arch_setup".  */
+/* Implementation of linux target ops method "low_arch_setup".  */
 
-static void
-riscv_arch_setup ()
+void
+riscv_target::low_arch_setup ()
 {
   static const char *expedite_regs[] = { "sp", "pc", NULL };
 
@@ -268,7 +271,6 @@ riscv_breakpoint_at (CORE_ADDR pc)
 /* RISC-V/Linux target operations.  */
 struct linux_target_ops the_low_target =
 {
-  riscv_arch_setup,
   riscv_regs_info,
   NULL, /* cannot_fetch_register */
   NULL, /* cannot_store_register */
diff --git a/gdbserver/linux-s390-low.cc b/gdbserver/linux-s390-low.cc
index 17aa9d0231..012e2fb88f 100644
--- a/gdbserver/linux-s390-low.cc
+++ b/gdbserver/linux-s390-low.cc
@@ -57,6 +57,9 @@ class s390_target : public linux_process_target
 {
 public:
 
+protected:
+
+  void low_arch_setup () override;
 };
 
 /* The singleton target ops object.  */
@@ -521,8 +524,8 @@ s390_check_regset (int pid, int regset, int regsize)
 static int have_hwcap_s390_high_gprs = 0;
 static int have_hwcap_s390_vx = 0;
 
-static void
-s390_arch_setup (void)
+void
+s390_target::low_arch_setup ()
 {
   const struct target_desc *tdesc;
   struct regset_info *regset;
@@ -2803,7 +2806,6 @@ s390_emit_ops (void)
 }
 
 struct linux_target_ops the_low_target = {
-  s390_arch_setup,
   s390_regs_info,
   s390_cannot_fetch_register,
   s390_cannot_store_register,
diff --git a/gdbserver/linux-sh-low.cc b/gdbserver/linux-sh-low.cc
index ab82ee37b2..48b905c960 100644
--- a/gdbserver/linux-sh-low.cc
+++ b/gdbserver/linux-sh-low.cc
@@ -25,6 +25,9 @@ class sh_target : public linux_process_target
 {
 public:
 
+protected:
+
+  void low_arch_setup () override;
 };
 
 /* The singleton target ops object.  */
@@ -148,14 +151,13 @@ sh_regs_info (void)
   return &regs_info;
 }
 
-static void
-sh_arch_setup (void)
+void
+sh_target::low_arch_setup ()
 {
   current_process ()->tdesc = tdesc_sh;
 }
 
 struct linux_target_ops the_low_target = {
-  sh_arch_setup,
   sh_regs_info,
   sh_cannot_fetch_register,
   sh_cannot_store_register,
diff --git a/gdbserver/linux-sparc-low.cc b/gdbserver/linux-sparc-low.cc
index cc4f551123..1ede07f446 100644
--- a/gdbserver/linux-sparc-low.cc
+++ b/gdbserver/linux-sparc-low.cc
@@ -48,6 +48,9 @@ class sparc_target : public linux_process_target
 {
 public:
 
+protected:
+
+  void low_arch_setup () override;
 };
 
 /* The singleton target ops object.  */
@@ -265,8 +268,8 @@ sparc_breakpoint_at (CORE_ADDR where)
   return 0;
 }
 
-static void
-sparc_arch_setup (void)
+void
+sparc_target::low_arch_setup ()
 {
   current_process ()->tdesc = tdesc_sparc64;
 }
@@ -310,7 +313,6 @@ sparc_regs_info (void)
 }
 
 struct linux_target_ops the_low_target = {
-  sparc_arch_setup,
   sparc_regs_info,
   sparc_cannot_fetch_register,
   sparc_cannot_store_register,
diff --git a/gdbserver/linux-tic6x-low.cc b/gdbserver/linux-tic6x-low.cc
index 4c621c0498..47ca9883a8 100644
--- a/gdbserver/linux-tic6x-low.cc
+++ b/gdbserver/linux-tic6x-low.cc
@@ -44,6 +44,9 @@ class tic6x_target : public linux_process_target
 {
 public:
 
+protected:
+
+  void low_arch_setup () override;
 };
 
 /* The singleton target ops object.  */
@@ -326,8 +329,8 @@ static struct regset_info tic6x_regsets[] = {
   NULL_REGSET
 };
 
-static void
-tic6x_arch_setup (void)
+void
+tic6x_target::low_arch_setup ()
 {
   register unsigned int csr asm ("B2");
   unsigned int cpuid;
@@ -398,7 +401,6 @@ tic6x_regs_info (void)
 }
 
 struct linux_target_ops the_low_target = {
-  tic6x_arch_setup,
   tic6x_regs_info,
   tic6x_cannot_fetch_register,
   tic6x_cannot_store_register,
diff --git a/gdbserver/linux-tile-low.cc b/gdbserver/linux-tile-low.cc
index 807a8976fd..293847efa2 100644
--- a/gdbserver/linux-tile-low.cc
+++ b/gdbserver/linux-tile-low.cc
@@ -29,6 +29,9 @@ class tile_target : public linux_process_target
 {
 public:
 
+protected:
+
+  void low_arch_setup () override;
 };
 
 /* The singleton target ops object.  */
@@ -159,8 +162,8 @@ tile_regs_info (void)
   return &regs_info;
 }
 
-static void
-tile_arch_setup (void)
+void
+tile_target::low_arch_setup ()
 {
   int pid = pid_of (current_thread);
   unsigned int machine;
@@ -187,7 +190,6 @@ tile_supports_hardware_single_step (void)
 
 struct linux_target_ops the_low_target =
 {
-  tile_arch_setup,
   tile_regs_info,
   tile_cannot_fetch_register,
   tile_cannot_store_register,
diff --git a/gdbserver/linux-x86-low.cc b/gdbserver/linux-x86-low.cc
index dbfcd25532..a15d5314b2 100644
--- a/gdbserver/linux-x86-low.cc
+++ b/gdbserver/linux-x86-low.cc
@@ -100,6 +100,13 @@ class x86_target : public linux_process_target
 {
 public:
 
+  /* Update all the target description of all processes; a new GDB
+     connected, and it may or not support xml target descriptions.  */
+  void update_xmltarget ();
+
+protected:
+
+  void low_arch_setup () override;
 };
 
 /* The singleton target ops object.  */
@@ -885,8 +892,8 @@ x86_linux_read_description (void)
 /* Update all the target description of all processes; a new GDB
    connected, and it may or not support xml target descriptions.  */
 
-static void
-x86_linux_update_xmltarget (void)
+void
+x86_target::update_xmltarget ()
 {
   struct thread_info *saved_thread = current_thread;
 
@@ -895,13 +902,13 @@ x86_linux_update_xmltarget (void)
      release the current regcache objects.  */
   regcache_release ();
 
-  for_each_process ([] (process_info *proc) {
+  for_each_process ([this] (process_info *proc) {
     int pid = proc->pid;
 
     /* Look up any thread of this process.  */
     current_thread = find_any_thread_of_pid (pid);
 
-    the_low_target.arch_setup ();
+    low_arch_setup ();
   });
 
   current_thread = saved_thread;
@@ -942,7 +949,7 @@ x86_linux_process_qsupported (char **features, int count)
 	  free (copy);
 	}
     }
-  x86_linux_update_xmltarget ();
+  the_x86_target.update_xmltarget ();
 }
 
 /* Common for x86/x86-64.  */
@@ -989,8 +996,8 @@ x86_linux_regs_info (void)
 /* Initialize the target description for the architecture of the
    inferior.  */
 
-static void
-x86_arch_setup (void)
+void
+x86_target::low_arch_setup ()
 {
   current_process ()->tdesc = x86_linux_read_description ();
 }
@@ -2872,7 +2879,6 @@ x86_get_ipa_tdesc_idx (void)
 
 struct linux_target_ops the_low_target =
 {
-  x86_arch_setup,
   x86_linux_regs_info,
   x86_cannot_fetch_register,
   x86_cannot_store_register,
diff --git a/gdbserver/linux-xtensa-low.cc b/gdbserver/linux-xtensa-low.cc
index 32146822d4..a7ed08541f 100644
--- a/gdbserver/linux-xtensa-low.cc
+++ b/gdbserver/linux-xtensa-low.cc
@@ -26,6 +26,9 @@ class xtensa_target : public linux_process_target
 {
 public:
 
+protected:
+
+  void low_arch_setup () override;
 };
 
 /* The singleton target ops object.  */
@@ -258,8 +261,8 @@ static struct regs_info regs_info =
     &xtensa_regsets_info
   };
 
-static void
-xtensa_arch_setup (void)
+void
+xtensa_target::low_arch_setup ()
 {
   current_process ()->tdesc = tdesc_xtensa;
 }
@@ -279,7 +282,6 @@ xtensa_regs_info (void)
 }
 
 struct linux_target_ops the_low_target = {
-  xtensa_arch_setup,
   xtensa_regs_info,
   0,
   0,


             reply	other threads:[~2020-04-17 12:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-17 12:38 gdb-buildbot [this message]
2020-04-17 12:38 ` Failures on Fedora-i686, branch master gdb-buildbot
2020-04-17 12:56 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2020-04-17 13:26 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2020-04-17 13:48 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2020-04-17 14:26 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2020-04-17 14:51 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2020-04-19 12:16 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot
2020-04-20  6:53 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot
2020-04-22  9:56 ` Failures on Ubuntu-Aarch64-m64, " gdb-buildbot
2020-04-22 10:12 ` Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, " gdb-buildbot

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=797bcff595c5e161b333077299fcaca19bb4fd17@gdb-build \
    --to=gdb-buildbot@sergiodj.net \
    --cc=gdb-testers@sourceware.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).