From patchwork Fri Mar 6 21:31:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aktemur, Tankut Baris" X-Patchwork-Id: 38510 Received: (qmail 55299 invoked by alias); 6 Mar 2020 21:33:01 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 53294 invoked by uid 89); 6 Mar 2020 21:32:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= X-HELO: mga09.intel.com Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Mar 2020 21:32:36 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2020 13:32:23 -0800 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 06 Mar 2020 13:32:22 -0800 Received: from ulvlx001.iul.intel.com (ulvlx001.iul.intel.com [172.28.207.17]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 026LWME5022518; Fri, 6 Mar 2020 21:32:22 GMT Received: from ulvlx001.iul.intel.com (localhost [127.0.0.1]) by ulvlx001.iul.intel.com with ESMTP id 026LWL8r020551; Fri, 6 Mar 2020 22:32:21 +0100 Received: (from taktemur@localhost) by ulvlx001.iul.intel.com with LOCAL id 026LWLbG020547; Fri, 6 Mar 2020 22:32:21 +0100 From: Tankut Baris Aktemur To: gdb-patches@sourceware.org Subject: [PATCH 30/31] gdbserver/linux-low: turn 'get_ipa_tdesc_idx' into a method Date: Fri, 6 Mar 2020 22:31:38 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes gdbserver/ChangeLog: 2020-03-06 Tankut Baris Aktemur 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) : Remove. * linux-low.cc (linux_process_target::get_ipa_tdesc_idx): Remove. * linux-x86-low.cc (class x86_target) : 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) : 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) : Declare. (s390_get_ipa_tdesc_idx): Turn into... (s390_target::get_ipa_tdesc_idx): ...this. (the_low_target): Remove the op field. --- 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 ++++--- 5 files changed, 14 insertions(+), 24 deletions(-) diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc index 25f895f7acf..f6081e75843 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 0ecdd06452e..3271a3f6a14 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; @@ -321,8 +319,6 @@ class linux_process_target : public process_stratum_target 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 1431b74031f..a671bcea1a7 100644 --- a/gdbserver/linux-ppc-low.cc +++ b/gdbserver/linux-ppc-low.cc @@ -81,6 +81,8 @@ public: struct emit_ops *emit_ops () override; + int get_ipa_tdesc_idx () override; + protected: void low_arch_setup () override; @@ -3394,10 +3396,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; @@ -3448,7 +3450,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 b44a3b9942f..f779635e202 100644 --- a/gdbserver/linux-s390-low.cc +++ b/gdbserver/linux-s390-low.cc @@ -90,6 +90,8 @@ public: struct emit_ops *emit_ops () override; + int get_ipa_tdesc_idx () override; + protected: void low_arch_setup () override; @@ -1439,10 +1441,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; @@ -2849,7 +2851,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 efffb9c7d30..a593644fb2b 100644 --- a/gdbserver/linux-x86-low.cc +++ b/gdbserver/linux-x86-low.cc @@ -126,6 +126,8 @@ public: struct emit_ops *emit_ops () override; + int get_ipa_tdesc_idx () override; + protected: void low_arch_setup () override; @@ -2967,8 +2969,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; @@ -2988,7 +2990,6 @@ x86_get_ipa_tdesc_idx (void) struct linux_target_ops the_low_target = { - x86_get_ipa_tdesc_idx, }; /* The linux target ops object. */