public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdbserver/linux-low: turn 'get_ipa_tdesc_idx' into a method
@ 2020-04-02 13:19 Tankut Baris Aktemur
  0 siblings, 0 replies; only message in thread
From: Tankut Baris Aktemur @ 2020-04-02 13:19 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fc5ecdb630406b68ce98c112e1fe618b5839c188

commit fc5ecdb630406b68ce98c112e1fe618b5839c188
Author: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Date:   Thu Apr 2 15:11:32 2020 +0200

    gdbserver/linux-low: turn 'get_ipa_tdesc_idx' into a method
    
    gdbserver/ChangeLog:
    2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
    
            Remove the 'get_ipa_tdesc_idx' linux target op and let a concrete
            linux target define the op by overriding the declaration in
            process_stratum_target.
    
            * linux-low.h (struct linux_target_ops): Remove the op.
            (class linux_process_target) <get_ipa_tdesc_idx>: Remove.
            * linux-low.cc (linux_process_target::get_ipa_tdesc_idx): Remove.
            * linux-x86-low.cc (class x86_target) <get_ipa_tdesc_idx>: Declare.
            (x86_get_ipa_tdesc_idx): Turn into...
            (x86_target::get_ipa_tdesc_idx): ...this.
            (the_low_target): Remove the op field.
            * linux-ppc-low.cc (class ppc_target) <get_ipa_tdesc_idx>: Declare.
            (ppc_get_ipa_tdesc_idx): Turn into...
            (ppc_target::get_ipa_tdesc_idx): ...this.
            (the_low_target): Remove the op field.
            * linux-s390-low.cc (class s390_target) <get_ipa_tdesc_idx>: Declare.
            (s390_get_ipa_tdesc_idx): Turn into...
            (s390_target::get_ipa_tdesc_idx): ...this.
            (the_low_target): Remove the op field.

Diff:
---
 gdbserver/ChangeLog         | 22 ++++++++++++++++++++++
 gdbserver/linux-low.cc      |  9 ---------
 gdbserver/linux-low.h       |  4 ----
 gdbserver/linux-ppc-low.cc  |  9 +++++----
 gdbserver/linux-s390-low.cc |  9 +++++----
 gdbserver/linux-x86-low.cc  |  7 ++++---
 6 files changed, 36 insertions(+), 24 deletions(-)

diff --git a/gdbserver/ChangeLog b/gdbserver/ChangeLog
index 4649ec2fb10..e51d3e09b5f 100644
--- a/gdbserver/ChangeLog
+++ b/gdbserver/ChangeLog
@@ -1,3 +1,25 @@
+2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
+
+	Remove the 'get_ipa_tdesc_idx' linux target op and let a concrete
+	linux target define the op by overriding the declaration in
+	process_stratum_target.
+
+	* linux-low.h (struct linux_target_ops): Remove the op.
+	(class linux_process_target) <get_ipa_tdesc_idx>: Remove.
+	* linux-low.cc (linux_process_target::get_ipa_tdesc_idx): Remove.
+	* linux-x86-low.cc (class x86_target) <get_ipa_tdesc_idx>: Declare.
+	(x86_get_ipa_tdesc_idx): Turn into...
+	(x86_target::get_ipa_tdesc_idx): ...this.
+	(the_low_target): Remove the op field.
+	* linux-ppc-low.cc (class ppc_target) <get_ipa_tdesc_idx>: Declare.
+	(ppc_get_ipa_tdesc_idx): Turn into...
+	(ppc_target::get_ipa_tdesc_idx): ...this.
+	(the_low_target): Remove the op field.
+	* linux-s390-low.cc (class s390_target) <get_ipa_tdesc_idx>: Declare.
+	(s390_get_ipa_tdesc_idx): Turn into...
+	(s390_target::get_ipa_tdesc_idx): ...this.
+	(the_low_target): Remove the op field.
+
 2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
 
 	Turn the 'get_syscall_trapinfo' linux target op into a method
diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc
index cd04160978d..3cd8d5594dc 100644
--- a/gdbserver/linux-low.cc
+++ b/gdbserver/linux-low.cc
@@ -6407,15 +6407,6 @@ linux_process_target::low_supports_catch_syscall ()
   return false;
 }
 
-int
-linux_process_target::get_ipa_tdesc_idx ()
-{
-  if (the_low_target.get_ipa_tdesc_idx == NULL)
-    return 0;
-
-  return (*the_low_target.get_ipa_tdesc_idx) ();
-}
-
 CORE_ADDR
 linux_process_target::read_pc (regcache *regcache)
 {
diff --git a/gdbserver/linux-low.h b/gdbserver/linux-low.h
index 1f1c3820edb..8ad56c33970 100644
--- a/gdbserver/linux-low.h
+++ b/gdbserver/linux-low.h
@@ -131,8 +131,6 @@ struct lwp_info;
 
 struct linux_target_ops
 {
-  /* See target.h.  */
-  int (*get_ipa_tdesc_idx) (void);
 };
 
 extern struct linux_target_ops the_low_target;
@@ -319,8 +317,6 @@ public:
 
   bool supports_catch_syscall () override;
 
-  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;
diff --git a/gdbserver/linux-ppc-low.cc b/gdbserver/linux-ppc-low.cc
index 71ad842243c..127de5b5fa3 100644
--- a/gdbserver/linux-ppc-low.cc
+++ b/gdbserver/linux-ppc-low.cc
@@ -79,6 +79,8 @@ public:
 
   struct emit_ops *emit_ops () override;
 
+  int get_ipa_tdesc_idx () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -3392,10 +3394,10 @@ ppc_target::emit_ops ()
   return &ppc_emit_ops_impl;
 }
 
-/* Implementation of linux_target_ops method "get_ipa_tdesc_idx".  */
+/* Implementation of target ops method "get_ipa_tdesc_idx".  */
 
-static int
-ppc_get_ipa_tdesc_idx (void)
+int
+ppc_target::get_ipa_tdesc_idx ()
 {
   struct regcache *regcache = get_thread_regcache (current_thread, 0);
   const struct target_desc *tdesc = regcache->tdesc;
@@ -3446,7 +3448,6 @@ ppc_get_ipa_tdesc_idx (void)
 }
 
 struct linux_target_ops the_low_target = {
-  ppc_get_ipa_tdesc_idx,
 };
 
 /* The linux target ops object.  */
diff --git a/gdbserver/linux-s390-low.cc b/gdbserver/linux-s390-low.cc
index d09860f36db..1c94be04f4b 100644
--- a/gdbserver/linux-s390-low.cc
+++ b/gdbserver/linux-s390-low.cc
@@ -85,6 +85,8 @@ public:
 
   struct emit_ops *emit_ops () override;
 
+  int get_ipa_tdesc_idx () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -1445,10 +1447,10 @@ s390_target::get_min_fast_tracepoint_insn_len ()
   return 6;
 }
 
-/* Implementation of linux_target_ops method "get_ipa_tdesc_idx".  */
+/* Implementation of target ops method "get_ipa_tdesc_idx".  */
 
-static int
-s390_get_ipa_tdesc_idx (void)
+int
+s390_target::get_ipa_tdesc_idx ()
 {
   struct regcache *regcache = get_thread_regcache (current_thread, 0);
   const struct target_desc *tdesc = regcache->tdesc;
@@ -2855,7 +2857,6 @@ s390_target::emit_ops ()
 }
 
 struct linux_target_ops the_low_target = {
-  s390_get_ipa_tdesc_idx,
 };
 
 /* The linux target ops object.  */
diff --git a/gdbserver/linux-x86-low.cc b/gdbserver/linux-x86-low.cc
index 2837994653d..67690914f8c 100644
--- a/gdbserver/linux-x86-low.cc
+++ b/gdbserver/linux-x86-low.cc
@@ -124,6 +124,8 @@ public:
 
   struct emit_ops *emit_ops () override;
 
+  int get_ipa_tdesc_idx () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -2974,8 +2976,8 @@ x86_target::low_supports_range_stepping ()
   return true;
 }
 
-static int
-x86_get_ipa_tdesc_idx (void)
+int
+x86_target::get_ipa_tdesc_idx ()
 {
   struct regcache *regcache = get_thread_regcache (current_thread, 0);
   const struct target_desc *tdesc = regcache->tdesc;
@@ -2995,7 +2997,6 @@ x86_get_ipa_tdesc_idx (void)
 
 struct linux_target_ops the_low_target =
 {
-  x86_get_ipa_tdesc_idx,
 };
 
 /* The linux target ops object.  */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-02 13:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-02 13:19 [binutils-gdb] gdbserver/linux-low: turn 'get_ipa_tdesc_idx' into a method Tankut Baris Aktemur

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).