gdbserver/linux-low: turn 'regs_info' into a method
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Thu, 2 Apr 2020 13:11:23 +0000 (15:11 +0200)
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Thu, 2 Apr 2020 13:11:23 +0000 (15:11 +0200)
gdbserver/ChangeLog:
2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

Turn the 'regs_info' linux target op into a method of
linux_process_target.

* linux-low.h (struct linux_target_ops) <regs_info>: Remove.
(class linux_process_target) <get_regs_info>: Define.

Update the callers below.

* linux-low.cc (linux_process_target::fetch_registers)
(linux_process_target::store_registers)
* proc-service.cc (gregset_info)

* linux-x86-low.cc (class x86_target) <get_regs_info>: Declare.
(x86_linux_regs_info): Turn into ...
(x86_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (class aarch64_target) <get_regs_info>:
Declare.
(aarch64_regs_info): Turn into ...
(aarch64_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-arm-low.cc (class arm_target) <get_regs_info>: Declare.
(arm_regs_info): Turn into ...
(arm_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-bfin-low.cc (class bfin_target) <get_regs_info>: Declare.
(bfin_regs_info): Turn into ...
(bfin_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-cris-low.cc (class cris_target) <get_regs_info>: Declare.
(cris_regs_info): Turn into ...
(cris_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-crisv32-low.cc (class crisv32_target) <get_regs_info>:
Declare.
(crisv32_regs_info): Turn into ...
(crisv32_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-ia64-low.cc (class ia64_target) <get_regs_info>: Declare.
(ia64_regs_info): Turn into ...
(ia64_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-m32r-low.cc (class m32r_target) <get_regs_info>: Declare.
(m32r_regs_info): Turn into ...
(m32r_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-m68k-low.cc (class m68k_target) <get_regs_info>: Declare.
(m68k_regs_info): Turn into ...
(m68k_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-mips-low.cc (class mips_target) <get_regs_info>: Declare.
(mips_regs_info): Turn into ...
(mips_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
(get_usrregs_info): Update the call to the op.
* linux-nios2-low.cc (class nios2_target) <get_regs_info>: Declare.
(nios2_regs_info): Turn into ...
(nios2_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-ppc-low.cc (class ppc_target) <get_regs_info>: Declare.
(ppc_regs_info): Turn into ...
(ppc_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-riscv-low.cc (class riscv_target) <get_regs_info>: Declare.
(riscv_regs_info): Turn into ...
(riscv_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-s390-low.cc (class s390_target) <get_regs_info>: Declare.
(s390_regs_info): Turn into ...
(s390_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
(s390_collect_ptrace_register)
(s390_supply_ptrace_register)
(s390_fill_gregset): Update the call to the op.
* linux-sh-low.cc (class sh_target) <get_regs_info>: Declare.
(sh_regs_info): Turn into ...
(sh_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-sparc-low.cc (class sparc_target) <get_regs_info>: Declare.
(sparc_regs_info): Turn into ...
(sparc_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-tic6x-low.cc (class tic6x_target) <get_regs_info>: Declare.
(tic6x_regs_info): Turn into ...
(tic6x_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-tile-low.cc (class tile_target) <get_regs_info>: Declare.
(tile_regs_info): Turn into ...
(tile_target::get_regs_info): ...this.
(the_low_target): Remove the op field.
* linux-xtensa-low.cc (class xtensa_target) <get_regs_info>:
Declare.
(xtensa_regs_info): Turn into ...
(xtensa_target::get_regs_info): ...this.
(the_low_target): Remove the op field.

23 files changed:
gdbserver/ChangeLog
gdbserver/linux-aarch64-low.cc
gdbserver/linux-arm-low.cc
gdbserver/linux-bfin-low.cc
gdbserver/linux-cris-low.cc
gdbserver/linux-crisv32-low.cc
gdbserver/linux-ia64-low.cc
gdbserver/linux-low.cc
gdbserver/linux-low.h
gdbserver/linux-m32r-low.cc
gdbserver/linux-m68k-low.cc
gdbserver/linux-mips-low.cc
gdbserver/linux-nios2-low.cc
gdbserver/linux-ppc-low.cc
gdbserver/linux-riscv-low.cc
gdbserver/linux-s390-low.cc
gdbserver/linux-sh-low.cc
gdbserver/linux-sparc-low.cc
gdbserver/linux-tic6x-low.cc
gdbserver/linux-tile-low.cc
gdbserver/linux-x86-low.cc
gdbserver/linux-xtensa-low.cc
gdbserver/proc-service.cc

index 4a9d7bc3e4f8c8910e7552b224e64fecc49229c0..bbfc628a3681ddf812f59841d43c57f70a583f5b 100644 (file)
@@ -1,3 +1,101 @@
+2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
+
+       Turn the 'regs_info' linux target op into a method of
+       linux_process_target.
+
+       * linux-low.h (struct linux_target_ops) <regs_info>: Remove.
+       (class linux_process_target) <get_regs_info>: Define.
+
+       Update the callers below.
+
+       * linux-low.cc (linux_process_target::fetch_registers)
+       (linux_process_target::store_registers)
+       * proc-service.cc (gregset_info)
+
+       * linux-x86-low.cc (class x86_target) <get_regs_info>: Declare.
+       (x86_linux_regs_info): Turn into ...
+       (x86_target::get_regs_info): ...this.
+       (the_low_target): Remove the op field.
+       * linux-aarch64-low.cc (class aarch64_target) <get_regs_info>:
+       Declare.
+       (aarch64_regs_info): Turn into ...
+       (aarch64_target::get_regs_info): ...this.
+       (the_low_target): Remove the op field.
+       * linux-arm-low.cc (class arm_target) <get_regs_info>: Declare.
+       (arm_regs_info): Turn into ...
+       (arm_target::get_regs_info): ...this.
+       (the_low_target): Remove the op field.
+       * linux-bfin-low.cc (class bfin_target) <get_regs_info>: Declare.
+       (bfin_regs_info): Turn into ...
+       (bfin_target::get_regs_info): ...this.
+       (the_low_target): Remove the op field.
+       * linux-cris-low.cc (class cris_target) <get_regs_info>: Declare.
+       (cris_regs_info): Turn into ...
+       (cris_target::get_regs_info): ...this.
+       (the_low_target): Remove the op field.
+       * linux-crisv32-low.cc (class crisv32_target) <get_regs_info>:
+       Declare.
+       (crisv32_regs_info): Turn into ...
+       (crisv32_target::get_regs_info): ...this.
+       (the_low_target): Remove the op field.
+       * linux-ia64-low.cc (class ia64_target) <get_regs_info>: Declare.
+       (ia64_regs_info): Turn into ...
+       (ia64_target::get_regs_info): ...this.
+       (the_low_target): Remove the op field.
+       * linux-m32r-low.cc (class m32r_target) <get_regs_info>: Declare.
+       (m32r_regs_info): Turn into ...
+       (m32r_target::get_regs_info): ...this.
+       (the_low_target): Remove the op field.
+       * linux-m68k-low.cc (class m68k_target) <get_regs_info>: Declare.
+       (m68k_regs_info): Turn into ...
+       (m68k_target::get_regs_info): ...this.
+       (the_low_target): Remove the op field.
+       * linux-mips-low.cc (class mips_target) <get_regs_info>: Declare.
+       (mips_regs_info): Turn into ...
+       (mips_target::get_regs_info): ...this.
+       (the_low_target): Remove the op field.
+       (get_usrregs_info): Update the call to the op.
+       * linux-nios2-low.cc (class nios2_target) <get_regs_info>: Declare.
+       (nios2_regs_info): Turn into ...
+       (nios2_target::get_regs_info): ...this.
+       (the_low_target): Remove the op field.
+       * linux-ppc-low.cc (class ppc_target) <get_regs_info>: Declare.
+       (ppc_regs_info): Turn into ...
+       (ppc_target::get_regs_info): ...this.
+       (the_low_target): Remove the op field.
+       * linux-riscv-low.cc (class riscv_target) <get_regs_info>: Declare.
+       (riscv_regs_info): Turn into ...
+       (riscv_target::get_regs_info): ...this.
+       (the_low_target): Remove the op field.
+       * linux-s390-low.cc (class s390_target) <get_regs_info>: Declare.
+       (s390_regs_info): Turn into ...
+       (s390_target::get_regs_info): ...this.
+       (the_low_target): Remove the op field.
+       (s390_collect_ptrace_register)
+       (s390_supply_ptrace_register)
+       (s390_fill_gregset): Update the call to the op.
+       * linux-sh-low.cc (class sh_target) <get_regs_info>: Declare.
+       (sh_regs_info): Turn into ...
+       (sh_target::get_regs_info): ...this.
+       (the_low_target): Remove the op field.
+       * linux-sparc-low.cc (class sparc_target) <get_regs_info>: Declare.
+       (sparc_regs_info): Turn into ...
+       (sparc_target::get_regs_info): ...this.
+       (the_low_target): Remove the op field.
+       * linux-tic6x-low.cc (class tic6x_target) <get_regs_info>: Declare.
+       (tic6x_regs_info): Turn into ...
+       (tic6x_target::get_regs_info): ...this.
+       (the_low_target): Remove the op field.
+       * linux-tile-low.cc (class tile_target) <get_regs_info>: Declare.
+       (tile_regs_info): Turn into ...
+       (tile_target::get_regs_info): ...this.
+       (the_low_target): Remove the op field.
+       * linux-xtensa-low.cc (class xtensa_target) <get_regs_info>:
+       Declare.
+       (xtensa_regs_info): Turn into ...
+       (xtensa_target::get_regs_info): ...this.
+       (the_low_target): Remove the op field.
+
 2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
 
        Turn the 'arch_setup' linux target op into a method of
index 44f729386cdfa34dfcb399a348c1756c99f31ef3..ebbfbe6cba37d6e7da01023b715a3ba403012d2e 100644 (file)
@@ -55,6 +55,8 @@ class aarch64_target : public linux_process_target
 {
 public:
 
+  const regs_info *get_regs_info () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -619,10 +621,10 @@ static struct regs_info regs_info_aarch64_sve =
     &aarch64_sve_regsets_info,
   };
 
-/* Implementation of linux_target_ops method "regs_info".  */
+/* Implementation of linux target ops method "get_regs_info".  */
 
-static const struct regs_info *
-aarch64_regs_info (void)
+const regs_info *
+aarch64_target::get_regs_info ()
 {
   if (!is_64bit_tdesc ())
     return &regs_info_aarch32;
@@ -3065,7 +3067,6 @@ aarch64_supports_hardware_single_step (void)
 
 struct linux_target_ops the_low_target =
 {
-  aarch64_regs_info,
   NULL, /* cannot_fetch_register */
   NULL, /* cannot_store_register */
   NULL, /* fetch_register */
index 17f9549a8875199f824f93aa65c8a1300a333f13..c59e8bddc08bb9ae138779883944de4d85b1d3ec 100644 (file)
@@ -60,6 +60,8 @@ class arm_target : public linux_process_target
 {
 public:
 
+  const regs_info *get_regs_info () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -1007,8 +1009,8 @@ static struct regs_info regs_info_arm =
     &arm_regsets_info
   };
 
-static const struct regs_info *
-arm_regs_info (void)
+const regs_info *
+arm_target::get_regs_info ()
 {
   const struct target_desc *tdesc = current_process ()->tdesc;
 
@@ -1021,7 +1023,6 @@ arm_regs_info (void)
 }
 
 struct linux_target_ops the_low_target = {
-  arm_regs_info,
   arm_cannot_fetch_register,
   arm_cannot_store_register,
   NULL, /* fetch_register */
index 8656b20a9321b466ff547188ae3a0dd318924acf..fee79b74da13220e4e1c4e392e11ff7cc0a6c329 100644 (file)
@@ -29,6 +29,8 @@ class bfin_target : public linux_process_target
 {
 public:
 
+  const regs_info *get_regs_info () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -116,20 +118,19 @@ static struct usrregs_info bfin_usrregs_info =
     bfin_regmap,
   };
 
-static struct regs_info regs_info =
+static struct regs_info myregs_info =
   {
     NULL, /* regset_bitmap */
     &bfin_usrregs_info,
   };
 
-static const struct regs_info *
-bfin_regs_info (void)
+const regs_info *
+bfin_target::get_regs_info ()
 {
-  return &regs_info;
+  return &myregs_info;
 }
 
 struct linux_target_ops the_low_target = {
-  bfin_regs_info,
   bfin_cannot_fetch_register,
   bfin_cannot_store_register,
   NULL, /* fetch_register */
index ea9dbda10e40ec6abef67e336f5db22549cf44b6..dcb7d3fd5f4677cef85b4b3b20a9c3f5365d7703 100644 (file)
@@ -26,6 +26,8 @@ class cris_target : public linux_process_target
 {
 public:
 
+  const regs_info *get_regs_info () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -113,20 +115,19 @@ static struct usrregs_info cris_usrregs_info =
     cris_regmap,
   };
 
-static struct regs_info regs_info =
+static struct regs_info myregs_info =
   {
     NULL, /* regset_bitmap */
     &cris_usrregs_info,
   };
 
-static const struct regs_info *
-cris_regs_info (void)
+const regs_info *
+cris_target::get_regs_info ()
 {
-  return &regs_info;
+  return &myregs_info;
 }
 
 struct linux_target_ops the_low_target = {
-  cris_regs_info,
   cris_cannot_fetch_register,
   cris_cannot_store_register,
   NULL, /* fetch_register */
index f57be1c1529fc182bc52db870107a18ab609d1c2..b7763ab13564a227ebf4012fbef0e0f02a1169c4 100644 (file)
@@ -26,6 +26,8 @@ class crisv32_target : public linux_process_target
 {
 public:
 
+  const regs_info *get_regs_info () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -395,21 +397,20 @@ static struct usrregs_info cris_usrregs_info =
     cris_regmap,
   };
 
-static struct regs_info regs_info =
+static struct regs_info myregs_info =
   {
     NULL, /* regset_bitmap */
     &cris_usrregs_info,
     &cris_regsets_info
   };
 
-static const struct regs_info *
-cris_regs_info (void)
+const regs_info *
+crisv32_target::get_regs_info ()
 {
-  return &regs_info;
+  return &myregs_info;
 }
 
 struct linux_target_ops the_low_target = {
-  cris_regs_info,
   NULL,
   NULL,
   NULL, /* fetch_register */
index bccab15dcc36e211926400f06d5fdd789da9d91f..d6508d2fb1de48f1808aac4f32b312037eb59166 100644 (file)
@@ -29,6 +29,8 @@ class ia64_target : public linux_process_target
 {
 public:
 
+  const regs_info *get_regs_info () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -341,16 +343,16 @@ static struct usrregs_info ia64_usrregs_info =
     ia64_regmap,
   };
 
-static struct regs_info regs_info =
+static struct regs_info myregs_info =
   {
     NULL, /* regset_bitmap */
     &ia64_usrregs_info
   };
 
-static const struct regs_info *
-ia64_regs_info (void)
+const regs_info *
+ia64_target::get_regs_info ()
 {
-  return &regs_info;
+  return &myregs_info;
 }
 
 void
@@ -361,7 +363,6 @@ ia64_target::low_arch_setup ()
 
 
 struct linux_target_ops the_low_target = {
-  ia64_regs_info,
   ia64_cannot_fetch_register,
   ia64_cannot_store_register,
   ia64_fetch_register,
index 55533371447fe64d35eb0500a9df9edeace14c17..546ca731d8f2271329191579382dc8e3a3c8f071 100644 (file)
@@ -5576,7 +5576,7 @@ linux_process_target::fetch_registers (regcache *regcache, int regno)
 {
   int use_regsets;
   int all = 0;
-  const struct regs_info *regs_info = (*the_low_target.regs_info) ();
+  const regs_info *regs_info = get_regs_info ();
 
   if (regno == -1)
     {
@@ -5609,7 +5609,7 @@ linux_process_target::store_registers (regcache *regcache, int regno)
 {
   int use_regsets;
   int all = 0;
-  const struct regs_info *regs_info = (*the_low_target.regs_info) ();
+  const regs_info *regs_info = get_regs_info ();
 
   if (regno == -1)
     {
index 26dc831f874ffe6e5be98027a7d9eda3fdb1a4ac..697b4af53a4f3ac79b94dfb0691b22cc4d9c2265 100644 (file)
@@ -131,8 +131,6 @@ struct lwp_info;
 
 struct linux_target_ops
 {
-  const struct regs_info *(*regs_info) (void);
-
   /* Return 0 if we can fetch/store the register, 1 if we cannot
      fetch/store the register.  */
   int (*cannot_fetch_register) (int);
@@ -478,6 +476,10 @@ public:
 
   int get_ipa_tdesc_idx () override;
 
+  /* Return the information to access registers.  This has public
+     visibility because proc-service uses it.  */
+  virtual const regs_info *get_regs_info () = 0;
+
 private:
 
   /* Handle a GNU/Linux extended wait response.  If we see a clone,
index 5186cc5bdc28689fef857765e2cd017f5f945061..2a5c6ea9bbe5a2b4e9a300b64577642f1d457372 100644 (file)
@@ -29,6 +29,8 @@ class m32r_target : public linux_process_target
 {
 public:
 
+  const regs_info *get_regs_info () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -115,20 +117,19 @@ static struct usrregs_info m32r_usrregs_info =
     m32r_regmap,
   };
 
-static struct regs_info regs_info =
+static struct regs_info myregs_info =
   {
     NULL, /* regset_bitmap */
     &m32r_usrregs_info,
   };
 
-static const struct regs_info *
-m32r_regs_info (void)
+const regs_info *
+m32r_target::get_regs_info ()
 {
-  return &regs_info;
+  return &myregs_info;
 }
 
 struct linux_target_ops the_low_target = {
-  m32r_regs_info,
   m32r_cannot_fetch_register,
   m32r_cannot_store_register,
   NULL, /* fetch_register */
index 667ca2ec152aa6478053692a75d982d694b3c565..cbecc7a7f525976329d9ff05cae987eb186fa87e 100644 (file)
@@ -25,6 +25,8 @@ class m68k_target : public linux_process_target
 {
 public:
 
+  const regs_info *get_regs_info () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -195,17 +197,17 @@ static struct usrregs_info m68k_usrregs_info =
     m68k_regmap,
   };
 
-static struct regs_info regs_info =
+static struct regs_info myregs_info =
   {
     NULL, /* regset_bitmap */
     &m68k_usrregs_info,
     &m68k_regsets_info
   };
 
-static const struct regs_info *
-m68k_regs_info (void)
+const regs_info *
+m68k_target::get_regs_info ()
 {
-  return &regs_info;
+  return &myregs_info;
 }
 
 void
@@ -223,7 +225,6 @@ m68k_supports_hardware_single_step (void)
 }
 
 struct linux_target_ops the_low_target = {
-  m68k_regs_info,
   m68k_cannot_fetch_register,
   m68k_cannot_store_register,
   NULL, /* fetch_register */
index 53a9d75e9e2a4f0c19c54e294d28efc3b2fa7374..8231217dac9acde7d2d4d90812bacf5da08dd9fc 100644 (file)
@@ -31,6 +31,8 @@ class mips_target : public linux_process_target
 {
 public:
 
+  const regs_info *get_regs_info () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -171,7 +173,7 @@ mips_target::low_arch_setup ()
 static struct usrregs_info *
 get_usrregs_info (void)
 {
-  const struct regs_info *regs_info = the_low_target.regs_info ();
+  const struct regs_info *regs_info = the_linux_target->get_regs_info ();
 
   return regs_info->usrregs;
 }
@@ -935,24 +937,23 @@ static struct regs_info dsp_regs_info =
     &mips_regsets_info
   };
 
-static struct regs_info regs_info =
+static struct regs_info myregs_info =
   {
     NULL, /* regset_bitmap */
     &mips_usrregs_info,
     &mips_regsets_info
   };
 
-static const struct regs_info *
-mips_regs_info (void)
+const regs_info *
+mips_target::get_regs_info ()
 {
   if (have_dsp)
     return &dsp_regs_info;
   else
-    return &regs_info;
+    return &myregs_info;
 }
 
 struct linux_target_ops the_low_target = {
-  mips_regs_info,
   mips_cannot_fetch_register,
   mips_cannot_store_register,
   mips_fetch_register,
index 1b680916547d3bbdff8d792eb8b3496587375495..2e19b8dc7de7041b27c3fecb1ccd4ca78fc79b1e 100644 (file)
@@ -37,6 +37,8 @@ class nios2_target : public linux_process_target
 {
 public:
 
+  const regs_info *get_regs_info () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -236,22 +238,21 @@ static struct usrregs_info nios2_usrregs_info =
     nios2_regmap,
   };
 
-static struct regs_info regs_info =
+static struct regs_info myregs_info =
   {
     NULL, /* regset_bitmap */
     &nios2_usrregs_info,
     &nios2_regsets_info
   };
 
-static const struct regs_info *
-nios2_regs_info (void)
+const regs_info *
+nios2_target::get_regs_info ()
 {
-  return &regs_info;
+  return &myregs_info;
 }
 
 struct linux_target_ops the_low_target =
 {
-  nios2_regs_info,
   nios2_cannot_fetch_register,
   nios2_cannot_store_register,
   NULL,
index fbd68830843f7771e410966748ab46adef92a0f2..fe63e7bf07b767479bdf9547e88e60e469633563 100644 (file)
@@ -50,6 +50,8 @@ class ppc_target : public linux_process_target
 {
 public:
 
+  const regs_info *get_regs_info () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -806,17 +808,17 @@ static struct regsets_info ppc_regsets_info =
     NULL, /* disabled_regsets */
   };
 
-static struct regs_info regs_info =
+static struct regs_info myregs_info =
   {
     NULL, /* regset_bitmap */
     &ppc_usrregs_info,
     &ppc_regsets_info
   };
 
-static const struct regs_info *
-ppc_regs_info (void)
+const regs_info *
+ppc_target::get_regs_info ()
 {
-  return &regs_info;
+  return &myregs_info;
 }
 
 void
@@ -3386,7 +3388,6 @@ ppc_get_ipa_tdesc_idx (void)
 }
 
 struct linux_target_ops the_low_target = {
-  ppc_regs_info,
   ppc_cannot_fetch_register,
   ppc_cannot_store_register,
   NULL, /* fetch_register */
index 4a9cefed7b457b448b9f561d228fd11b738be9d2..092f497b85ab95066650071f59118892833d4f80 100644 (file)
@@ -36,6 +36,8 @@ class riscv_target : public linux_process_target
 {
 public:
 
+  const regs_info *get_regs_info () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -160,10 +162,10 @@ static struct regs_info riscv_regs =
     &riscv_regsets_info,
   };
 
-/* Implementation of linux_target_ops method "regs_info".  */
+/* Implementation of linux target ops method "get_regs_info".  */
 
-static const struct regs_info *
-riscv_regs_info ()
+const regs_info *
+riscv_target::get_regs_info ()
 {
   return &riscv_regs;
 }
@@ -271,7 +273,6 @@ riscv_breakpoint_at (CORE_ADDR pc)
 /* RISC-V/Linux target operations.  */
 struct linux_target_ops the_low_target =
 {
-  riscv_regs_info,
   NULL, /* cannot_fetch_register */
   NULL, /* cannot_store_register */
   riscv_fetch_register,
index 012e2fb88f28ec730c5b3f03dc981720a2217fda..464f60d8d42b80822360725047ef84aaa5395121 100644 (file)
@@ -57,6 +57,8 @@ class s390_target : public linux_process_target
 {
 public:
 
+  const regs_info *get_regs_info () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -171,7 +173,7 @@ static void
 s390_collect_ptrace_register (struct regcache *regcache, int regno, char *buf)
 {
   int size = register_size (regcache->tdesc, regno);
-  const struct regs_info *regs_info = (*the_low_target.regs_info) ();
+  const struct regs_info *regs_info = the_linux_target->get_regs_info ();
   struct usrregs_info *usr = regs_info->usrregs;
   int regaddr = usr->regmap[regno];
 
@@ -218,7 +220,7 @@ s390_supply_ptrace_register (struct regcache *regcache,
                             int regno, const char *buf)
 {
   int size = register_size (regcache->tdesc, regno);
-  const struct regs_info *regs_info = (*the_low_target.regs_info) ();
+  const struct regs_info *regs_info = the_linux_target->get_regs_info ();
   struct usrregs_info *usr = regs_info->usrregs;
   int regaddr = usr->regmap[regno];
 
@@ -276,7 +278,7 @@ static void
 s390_fill_gregset (struct regcache *regcache, void *buf)
 {
   int i;
-  const struct regs_info *regs_info = (*the_low_target.regs_info) ();
+  const struct regs_info *regs_info = the_linux_target->get_regs_info ();
   struct usrregs_info *usr = regs_info->usrregs;
 
   for (i = 0; i < usr->num_regs; i++)
@@ -687,7 +689,7 @@ static struct regsets_info s390_regsets_info =
     NULL, /* disabled_regsets */
   };
 
-static struct regs_info regs_info =
+static struct regs_info myregs_info =
   {
     NULL, /* regset_bitmap */
     &s390_usrregs_info,
@@ -714,8 +716,8 @@ static struct regs_info regs_info_3264 =
     &s390_regsets_info_3264
   };
 
-static const struct regs_info *
-s390_regs_info (void)
+const regs_info *
+s390_target::get_regs_info ()
 {
   if (have_hwcap_s390_high_gprs)
     {
@@ -728,7 +730,7 @@ s390_regs_info (void)
       return &regs_info_3264;
 #endif
     }
-  return &regs_info;
+  return &myregs_info;
 }
 
 /* The "supports_tracepoints" linux_target_ops method.  */
@@ -2806,7 +2808,6 @@ s390_emit_ops (void)
 }
 
 struct linux_target_ops the_low_target = {
-  s390_regs_info,
   s390_cannot_fetch_register,
   s390_cannot_store_register,
   NULL, /* fetch_register */
index 48b905c960bda561063c232ec8f62f445b02ab36..d47cd402def1f4c71e586f0d3cdcd479400d515f 100644 (file)
@@ -25,6 +25,8 @@ class sh_target : public linux_process_target
 {
 public:
 
+  const regs_info *get_regs_info () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -138,17 +140,17 @@ static struct usrregs_info sh_usrregs_info =
     sh_regmap,
   };
 
-static struct regs_info regs_info =
+static struct regs_info myregs_info =
   {
     NULL, /* regset_bitmap */
     &sh_usrregs_info,
     &sh_regsets_info
   };
 
-static const struct regs_info *
-sh_regs_info (void)
+const regs_info *
+sh_target::get_regs_info ()
 {
-  return &regs_info;
+  return &myregs_info;
 }
 
 void
@@ -158,7 +160,6 @@ sh_target::low_arch_setup ()
 }
 
 struct linux_target_ops the_low_target = {
-  sh_regs_info,
   sh_cannot_fetch_register,
   sh_cannot_store_register,
   NULL, /* fetch_register */
index 1ede07f44691970302b0a3fd2d43b2488c86670a..7be5c15c25620aecd65f717d7a2dca6f38b383e0 100644 (file)
@@ -48,6 +48,8 @@ class sparc_target : public linux_process_target
 {
 public:
 
+  const regs_info *get_regs_info () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -299,21 +301,20 @@ static struct usrregs_info sparc_usrregs_info =
     NULL
   };
 
-static struct regs_info regs_info =
+static struct regs_info myregs_info =
   {
     NULL, /* regset_bitmap */
     &sparc_usrregs_info,
     &sparc_regsets_info
   };
 
-static const struct regs_info *
-sparc_regs_info (void)
+const regs_info *
+sparc_target::get_regs_info ()
 {
-  return &regs_info;
+  return &myregs_info;
 }
 
 struct linux_target_ops the_low_target = {
-  sparc_regs_info,
   sparc_cannot_fetch_register,
   sparc_cannot_store_register,
   NULL, /* fetch_register */
index 47ca9883a80ba6d5a64a82da671c613a8164573c..1f8d2f6451e31d8444bb6e9c4642bb7ddf69a6f7 100644 (file)
@@ -44,6 +44,8 @@ class tic6x_target : public linux_process_target
 {
 public:
 
+  const regs_info *get_regs_info () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -387,21 +389,20 @@ static struct regsets_info tic6x_regsets_info =
     NULL, /* disabled_regsets */
   };
 
-static struct regs_info regs_info =
+static struct regs_info myregs_info =
   {
     NULL, /* regset_bitmap */
     &tic6x_usrregs_info,
     &tic6x_regsets_info
   };
 
-static const struct regs_info *
-tic6x_regs_info (void)
+const regs_info *
+tic6x_target::get_regs_info ()
 {
-  return &regs_info;
+  return &myregs_info;
 }
 
 struct linux_target_ops the_low_target = {
-  tic6x_regs_info,
   tic6x_cannot_fetch_register,
   tic6x_cannot_store_register,
   NULL, /* fetch_register */
index 293847efa24d6ec576bf3b2833b3fca9128d9fb8..6f173ccdf83d85b392998d79d76a4ddff8d60f82 100644 (file)
@@ -29,6 +29,8 @@ class tile_target : public linux_process_target
 {
 public:
 
+  const regs_info *get_regs_info () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -149,17 +151,17 @@ static struct usrregs_info tile_usrregs_info =
     tile_regmap,
   };
 
-static struct regs_info regs_info =
+static struct regs_info myregs_info =
   {
     NULL, /* regset_bitmap */
     &tile_usrregs_info,
     &tile_regsets_info,
   };
 
-static const struct regs_info *
-tile_regs_info (void)
+const regs_info *
+tile_target::get_regs_info ()
 {
-  return &regs_info;
+  return &myregs_info;
 }
 
 void
@@ -190,7 +192,6 @@ tile_supports_hardware_single_step (void)
 
 struct linux_target_ops the_low_target =
 {
-  tile_regs_info,
   tile_cannot_fetch_register,
   tile_cannot_store_register,
   NULL,
index a15d5314b2c413ebd45e9d5fbc17593924581972..4fdeeef2eeebe971f0ad768a9ec9e839ea96185a 100644 (file)
@@ -104,6 +104,8 @@ public:
      connected, and it may or not support xml target descriptions.  */
   void update_xmltarget ();
 
+  const regs_info *get_regs_info () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -982,8 +984,8 @@ static struct regs_info i386_linux_regs_info =
     &x86_regsets_info
   };
 
-static const struct regs_info *
-x86_linux_regs_info (void)
+const regs_info *
+x86_target::get_regs_info ()
 {
 #ifdef __x86_64__
   if (is_64bit_tdesc ())
@@ -2879,7 +2881,6 @@ x86_get_ipa_tdesc_idx (void)
 
 struct linux_target_ops the_low_target =
 {
-  x86_linux_regs_info,
   x86_cannot_fetch_register,
   x86_cannot_store_register,
   NULL, /* fetch_register */
index a7ed08541f5f45948f0293a1faecc0f8ac7044fe..ee2cd3bd9a46fccfb4332c6ed373f73b14cc7494 100644 (file)
@@ -26,6 +26,8 @@ class xtensa_target : public linux_process_target
 {
 public:
 
+  const regs_info *get_regs_info () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -254,7 +256,7 @@ static struct regsets_info xtensa_regsets_info =
     NULL, /* disabled_regsets */
   };
 
-static struct regs_info regs_info =
+static struct regs_info myregs_info =
   {
     NULL, /* regset_bitmap */
     NULL, /* usrregs */
@@ -275,14 +277,13 @@ xtensa_supports_hardware_single_step (void)
   return 1;
 }
 
-static const struct regs_info *
-xtensa_regs_info (void)
+const regs_info *
+xtensa_target::get_regs_info ()
 {
-  return &regs_info;
+  return &myregs_info;
 }
 
 struct linux_target_ops the_low_target = {
-  xtensa_regs_info,
   0,
   0,
   NULL, /* fetch_register */
index 9c8885ea91213ef4ef15a10c89f1a1424e193178..803c704e3f34b68f2c1fff185d9cea0d6a645fac 100644 (file)
@@ -42,7 +42,7 @@ static struct regset_info *
 gregset_info (void)
 {
   int i = 0;
-  const struct regs_info *regs_info = (*the_low_target.regs_info) ();
+  const regs_info *regs_info = the_linux_target->get_regs_info ();
   struct regsets_info *regsets_info = regs_info->regsets_info;
 
   while (regsets_info->regsets[i].size != -1)