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

Remove the 'emit_ops' linux target ops and let the concrete
linux target define the op by overriding the declaration of
process_stratum_target.

* linux-low.h (struct linux_target_ops): Remove the op.
(class linux_process_target) <emit_ops>: Remove.
* linux-low.cc (linux_process_target::emit_ops): Remove.
* linux-x86-low.cc (class x86_target) <emit_ops>: Declare.
(x86_emit_ops): Turn into...
(x86_target::emit_ops): ...this.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (class aarch64_target) <emit_ops>: Declare.
(aarch64_emit_ops): Turn into...
(aarch64_target::emit_ops): ...this.
(the_low_target): Remove the op field.
* linux-ppc-low.cc (class ppc_target) <emit_ops>: Declare.
(ppc_emit_ops): Turn into...
(ppc_target::emit_ops): ...this.
(the_low_target): Remove the op field.
* linux-s390-low.cc (class s390_target) <emit_ops>: Declare.
(s390_emit_ops): Turn into...
(s390_target::emit_ops): ...this.
(the_low_target): Remove the op field.
* linux-arm-low.cc (the_low_target): Remove the op field.
* linux-bfin-low.cc (the_low_target): Ditto.
* linux-crisv32-low.cc (the_low_target): Ditto.
* linux-m32r-low.cc (the_low_target): Ditto.
* linux-m68k-low.cc (the_low_target): Ditto.
* linux-sh-low.cc (the_low_target): Ditto.
* linux-tic6x-low.cc (the_low_target): Ditto.
* linux-tile-low.cc (the_low_target): Ditto.
* linux-xtensa-low.cc (the_low_target): Ditto.

16 files changed:
gdbserver/ChangeLog
gdbserver/linux-aarch64-low.cc
gdbserver/linux-arm-low.cc
gdbserver/linux-bfin-low.cc
gdbserver/linux-crisv32-low.cc
gdbserver/linux-low.cc
gdbserver/linux-low.h
gdbserver/linux-m32r-low.cc
gdbserver/linux-m68k-low.cc
gdbserver/linux-ppc-low.cc
gdbserver/linux-s390-low.cc
gdbserver/linux-sh-low.cc
gdbserver/linux-tic6x-low.cc
gdbserver/linux-tile-low.cc
gdbserver/linux-x86-low.cc
gdbserver/linux-xtensa-low.cc

index a7689caeea36bf924442574e66f3aae171cceb91..203b53453cf4af4f2e6d3691c5c31cc0c674d32f 100644 (file)
@@ -1,3 +1,38 @@
+2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
+
+       Remove the 'emit_ops' linux target ops and let the concrete
+       linux target define the op by overriding the declaration of
+       process_stratum_target.
+
+       * linux-low.h (struct linux_target_ops): Remove the op.
+       (class linux_process_target) <emit_ops>: Remove.
+       * linux-low.cc (linux_process_target::emit_ops): Remove.
+       * linux-x86-low.cc (class x86_target) <emit_ops>: Declare.
+       (x86_emit_ops): Turn into...
+       (x86_target::emit_ops): ...this.
+       (the_low_target): Remove the op field.
+       * linux-aarch64-low.cc (class aarch64_target) <emit_ops>: Declare.
+       (aarch64_emit_ops): Turn into...
+       (aarch64_target::emit_ops): ...this.
+       (the_low_target): Remove the op field.
+       * linux-ppc-low.cc (class ppc_target) <emit_ops>: Declare.
+       (ppc_emit_ops): Turn into...
+       (ppc_target::emit_ops): ...this.
+       (the_low_target): Remove the op field.
+       * linux-s390-low.cc (class s390_target) <emit_ops>: Declare.
+       (s390_emit_ops): Turn into...
+       (s390_target::emit_ops): ...this.
+       (the_low_target): Remove the op field.
+       * linux-arm-low.cc (the_low_target): Remove the op field.
+       * linux-bfin-low.cc (the_low_target): Ditto.
+       * linux-crisv32-low.cc (the_low_target): Ditto.
+       * linux-m32r-low.cc (the_low_target): Ditto.
+       * linux-m68k-low.cc (the_low_target): Ditto.
+       * linux-sh-low.cc (the_low_target): Ditto.
+       * linux-tic6x-low.cc (the_low_target): Ditto.
+       * linux-tile-low.cc (the_low_target): Ditto.
+       * linux-xtensa-low.cc (the_low_target): Ditto.
+
 2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
 
        Remove the 'install_fast_tracepoint_jump_pad' and
index 37fe93c89591799748a20a0ec6b29198f6d9e2b8..c9893c80fcd2981854d74b9d01fc0588216abafd 100644 (file)
@@ -79,6 +79,8 @@ public:
 
   int get_min_fast_tracepoint_insn_len () override;
 
+  struct emit_ops *emit_ops () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -3091,10 +3093,10 @@ static struct emit_ops aarch64_emit_ops_impl =
   aarch64_emit_ge_got,
 };
 
-/* Implementation of linux_target_ops method "emit_ops".  */
+/* Implementation of target ops method "emit_ops".  */
 
-static struct emit_ops *
-aarch64_emit_ops (void)
+emit_ops *
+aarch64_target::emit_ops ()
 {
   return &aarch64_emit_ops_impl;
 }
@@ -3163,7 +3165,6 @@ aarch64_supports_hardware_single_step (void)
 
 struct linux_target_ops the_low_target =
 {
-  aarch64_emit_ops,
   aarch64_supports_range_stepping,
   aarch64_supports_hardware_single_step,
   aarch64_get_syscall_trapinfo,
index 942f26302365944e7bce36f90cdf20a7965af507..a235f4e1c55422cfd56573a5782bbae6bf47c1e7 100644 (file)
@@ -1117,7 +1117,6 @@ arm_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* emit_ops */
   NULL, /* supports_range_stepping */
   arm_supports_hardware_single_step,
   arm_get_syscall_trapinfo,
index 4eaa19ebf3dbce5de849ae9d47da415a0111751e..b20edf7adc4a0bebb079056aa22bd023d3de87c0 100644 (file)
@@ -171,7 +171,6 @@ bfin_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* emit_ops */
   NULL, /* supports_range_stepping */
   bfin_supports_hardware_single_step,
 };
index 25816cc381289a2f0c89c19646071b392e8c6e91..ca56cabecd3da5eaa956deab30657821076d8c91 100644 (file)
@@ -468,7 +468,6 @@ crisv32_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* emit_ops */
   NULL, /* supports_range_stepping */
   cris_supports_hardware_single_step,
 };
index f93d495daabce200a282e644125ef517de3b0b72..71cc140d69db6363daa0514005bcdbf893afc6d1 100644 (file)
@@ -6496,15 +6496,6 @@ linux_process_target::done_accessing_memory ()
     target_unpause_all (true);
 }
 
-emit_ops *
-linux_process_target::emit_ops ()
-{
-  if (the_low_target.emit_ops != NULL)
-    return (*the_low_target.emit_ops) ();
-  else
-    return NULL;
-}
-
 /* Extract &phdr and num_phdr in the inferior.  Return 0 on success.  */
 
 static int
index 7c0e358b5b45ff283675587ef35400030fc91fe1..6db56d0e10698e502a11e9a6e88d87ef0b7fb6c1 100644 (file)
@@ -131,10 +131,6 @@ struct lwp_info;
 
 struct linux_target_ops
 {
-  /* Return the bytecode operations vector for the current inferior.
-     Returns NULL if bytecode compilation is not supported.  */
-  struct emit_ops *(*emit_ops) (void);
-
   /* Returns true if the low target supports range stepping.  */
   int (*supports_range_stepping) (void);
 
@@ -284,8 +280,6 @@ public:
 
   void stabilize_threads () override;
 
-  struct emit_ops *emit_ops () override;
-
   bool supports_disable_randomization () override;
 
   bool supports_qxfer_libraries_svr4 () override;
index 8ce65dac8497eb1194e7a316a6a0ce819d7427ac..82dde9938bd4107dd39a520e30edf56f0b59422e 100644 (file)
@@ -161,7 +161,6 @@ m32r_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* emit_ops */
   NULL, /* supports_range_stepping */
   m32r_supports_hardware_single_step,
 };
index 017b26bca817a7bb19abf6bd59270c6ba3423033..0b30291d3fb3bf28bddc33cdc83a50286d6915a9 100644 (file)
@@ -265,7 +265,6 @@ m68k_supports_hardware_single_step (void)
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* emit_ops */
   NULL, /* supports_range_stepping */
   m68k_supports_hardware_single_step,
 };
index 09a9be306f01af32c3eb84e41e125a7802f707e6..58f6629917cf9ccc5bf170af7aaf34de42adcbe7 100644 (file)
@@ -77,6 +77,8 @@ public:
 
   int get_min_fast_tracepoint_insn_len () override;
 
+  struct emit_ops *emit_ops () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -3379,10 +3381,10 @@ static struct emit_ops ppc64v2_emit_ops_impl =
 
 #endif
 
-/* Implementation of linux_target_ops method "emit_ops".  */
+/* Implementation of target ops method "emit_ops".  */
 
-static struct emit_ops *
-ppc_emit_ops (void)
+emit_ops *
+ppc_target::emit_ops ()
 {
 #ifdef __powerpc64__
   struct regcache *regcache = get_thread_regcache (current_thread, 0);
@@ -3452,7 +3454,6 @@ ppc_get_ipa_tdesc_idx (void)
 }
 
 struct linux_target_ops the_low_target = {
-  ppc_emit_ops,
   NULL, /* supports_range_stepping */
   ppc_supports_hardware_single_step,
   NULL, /* get_syscall_trapinfo */
index 2b093b898bdc9342e464ae152a010e90effb19c7..5ea4830dd1628323dfd8226905bf92311a8a439f 100644 (file)
@@ -83,6 +83,8 @@ public:
   void low_supply_ptrace_register (regcache *regcache, int regno,
                                   const char *buf) override;
 
+  struct emit_ops *emit_ops () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -2845,10 +2847,10 @@ static struct emit_ops s390x_emit_ops =
   };
 #endif
 
-/* The "emit_ops" linux_target_ops method.  */
+/* The "emit_ops" target ops method.  */
 
-static struct emit_ops *
-s390_emit_ops (void)
+emit_ops *
+s390_target::emit_ops ()
 {
 #ifdef __s390x__
   struct regcache *regcache = get_thread_regcache (current_thread, 0);
@@ -2861,7 +2863,6 @@ s390_emit_ops (void)
 }
 
 struct linux_target_ops the_low_target = {
-  s390_emit_ops,
   NULL, /* supports_range_stepping */
   s390_supports_hardware_single_step,
   NULL, /* get_syscall_trapinfo */
index 847f686380caff8b3d6fbfa04330ca8df8caf0b4..6f270ed989ed5103a037e1f376d699f416e98c01 100644 (file)
@@ -192,7 +192,6 @@ sh_target::low_arch_setup ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* emit_ops */
   NULL, /* supports_range_stepping */
   sh_supports_hardware_single_step,
 };
index 220681e9cece5ae2a0cf54171aba74f648dc26ef..6a0be06da5e498304facf09d3efeca2278d40d2f 100644 (file)
@@ -423,7 +423,6 @@ tic6x_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* emit_ops */
   NULL, /* supports_range_stepping */
   tic6x_supports_hardware_single_step,
 };
index 7a840c4dbd68e0b5dff763d893ee362bc6882d49..b18134d6d8a801c358440350439918e5e7d4dea3 100644 (file)
@@ -224,7 +224,6 @@ tile_supports_hardware_single_step (void)
 
 struct linux_target_ops the_low_target =
 {
-  NULL, /* emit_ops */
   NULL, /* supports_range_stepping */
   tile_supports_hardware_single_step,
 };
index de992fc062eea3660ea28052ac88fdef706edf81..8e35ab172bf16f49828ad5cea4fca6f3f2c2e456 100644 (file)
@@ -122,6 +122,8 @@ public:
 
   int get_min_fast_tracepoint_insn_len () override;
 
+  struct emit_ops *emit_ops () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -2934,8 +2936,8 @@ struct emit_ops i386_emit_ops =
   };
 
 
-static struct emit_ops *
-x86_emit_ops (void)
+emit_ops *
+x86_target::emit_ops ()
 {
 #ifdef __x86_64__
   if (is_64bit_tdesc ())
@@ -2990,7 +2992,6 @@ x86_get_ipa_tdesc_idx (void)
 
 struct linux_target_ops the_low_target =
 {
-  x86_emit_ops,
   x86_supports_range_stepping,
   x86_supports_hardware_single_step,
   x86_get_syscall_trapinfo,
index 94501216e0c8b46485c40de1e10720a83958d46a..774ad0a2ccbe3700de37295af93a101c4ab41ebb 100644 (file)
@@ -329,7 +329,6 @@ xtensa_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* emit_ops */
   NULL, /* supports_range_stepping */
   xtensa_supports_hardware_single_step,
 };
This page took 0.039202 seconds and 4 git commands to generate.