From patchwork Fri Mar 6 21:31:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tankut Baris Aktemur X-Patchwork-Id: 38506 Received: (qmail 54289 invoked by alias); 6 Mar 2020 21:32:53 -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 52998 invoked by uid 89); 6 Mar 2020 21:32:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.6 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: mga03.intel.com Received: from mga03.intel.com (HELO mga03.intel.com) (134.134.136.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Mar 2020 21:32:25 +0000 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2020 13:32:21 -0800 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga004.jf.intel.com with ESMTP; 06 Mar 2020 13:32:20 -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 026LWKnP022491; Fri, 6 Mar 2020 21:32:20 GMT Received: from ulvlx001.iul.intel.com (localhost [127.0.0.1]) by ulvlx001.iul.intel.com with ESMTP id 026LWKj6020495; Fri, 6 Mar 2020 22:32:20 +0100 Received: (from taktemur@localhost) by ulvlx001.iul.intel.com with LOCAL id 026LWJUV020491; Fri, 6 Mar 2020 22:32:20 +0100 From: Tankut Baris Aktemur To: gdb-patches@sourceware.org Subject: [PATCH 22/31] gdbserver/linux-low: turn 'process_qsupported' into a method Date: Fri, 6 Mar 2020 22:31:30 +0100 Message-Id: <1eccf2363d11b0e84182d97fcbfe45ee3b4a7934.1583529167.git.tankut.baris.aktemur@intel.com> In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes gdbserver/ChangeLog: 2020-03-06 Tankut Baris Aktemur Remove the 'process_qsupported' linux target op and let a concrete linux target define the op by overriding the op 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::process_qsupported): Remove. * linux-x86-low.cc (class x86_target) : Declare. (x86_linux_process_qsupported): Turn into... (x86_target::process_qsupported): ...this. (the_low_target): Remove the op field. * linux-aarch64-low.cc (the_low_target): Remove the op field. * linux-arm-low.cc (the_low_target): Ditto. * 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-ppc-low.cc (the_low_target): Ditto. * linux-s390-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. --- gdbserver/linux-aarch64-low.cc | 1 - gdbserver/linux-arm-low.cc | 1 - gdbserver/linux-bfin-low.cc | 1 - gdbserver/linux-crisv32-low.cc | 1 - gdbserver/linux-low.cc | 7 ------- gdbserver/linux-low.h | 5 ----- gdbserver/linux-m32r-low.cc | 1 - gdbserver/linux-m68k-low.cc | 1 - gdbserver/linux-ppc-low.cc | 1 - gdbserver/linux-s390-low.cc | 1 - gdbserver/linux-sh-low.cc | 1 - gdbserver/linux-tic6x-low.cc | 1 - gdbserver/linux-tile-low.cc | 1 - gdbserver/linux-x86-low.cc | 19 +++++++++++-------- gdbserver/linux-xtensa-low.cc | 1 - 15 files changed, 11 insertions(+), 32 deletions(-) diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc index cece3fc6dca..e6b6c871846 100644 --- a/gdbserver/linux-aarch64-low.cc +++ b/gdbserver/linux-aarch64-low.cc @@ -3148,7 +3148,6 @@ aarch64_supports_hardware_single_step (void) struct linux_target_ops the_low_target = { - NULL, /* process_qsupported */ aarch64_supports_tracepoints, aarch64_get_thread_area, aarch64_install_fast_tracepoint_jump_pad, diff --git a/gdbserver/linux-arm-low.cc b/gdbserver/linux-arm-low.cc index 83a7608c787..d2a7bf2eb9f 100644 --- a/gdbserver/linux-arm-low.cc +++ b/gdbserver/linux-arm-low.cc @@ -1119,7 +1119,6 @@ arm_target::get_regs_info () } struct linux_target_ops the_low_target = { - NULL, /* process_qsupported */ NULL, /* supports_tracepoints */ NULL, /* get_thread_area */ NULL, /* install_fast_tracepoint_jump_pad */ diff --git a/gdbserver/linux-bfin-low.cc b/gdbserver/linux-bfin-low.cc index 82bae1d1e82..9483c31d5f4 100644 --- a/gdbserver/linux-bfin-low.cc +++ b/gdbserver/linux-bfin-low.cc @@ -165,7 +165,6 @@ bfin_target::get_regs_info () } struct linux_target_ops the_low_target = { - NULL, /* process_qsupported */ NULL, /* supports_tracepoints */ NULL, /* get_thread_area */ NULL, /* install_fast_tracepoint_jump_pad */ diff --git a/gdbserver/linux-crisv32-low.cc b/gdbserver/linux-crisv32-low.cc index b85eac87698..3512178dd44 100644 --- a/gdbserver/linux-crisv32-low.cc +++ b/gdbserver/linux-crisv32-low.cc @@ -470,7 +470,6 @@ crisv32_target::get_regs_info () } struct linux_target_ops the_low_target = { - NULL, /* process_qsupported */ NULL, /* supports_tracepoints */ NULL, /* get_thread_area */ NULL, /* install_fast_tracepoint_jump_pad */ diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc index 41bb44a2010..99bcb25c6d0 100644 --- a/gdbserver/linux-low.cc +++ b/gdbserver/linux-low.cc @@ -6425,13 +6425,6 @@ linux_process_target::read_loadmap (const char *annex, CORE_ADDR offset, } #endif /* defined PT_GETDSBT || defined PTRACE_GETFDPIC */ -void -linux_process_target::process_qsupported (char **features, int count) -{ - if (the_low_target.process_qsupported != NULL) - the_low_target.process_qsupported (features, count); -} - bool linux_process_target::supports_catch_syscall () { diff --git a/gdbserver/linux-low.h b/gdbserver/linux-low.h index 0ccc8644c07..0b0a1573593 100644 --- a/gdbserver/linux-low.h +++ b/gdbserver/linux-low.h @@ -131,9 +131,6 @@ struct lwp_info; struct linux_target_ops { - /* Hook to support target specific qSupported. */ - void (*process_qsupported) (char **, int count); - /* Returns true if the low target supports tracepoints. */ int (*supports_tracepoints) (void); @@ -301,8 +298,6 @@ class linux_process_target : public process_stratum_target unsigned char *myaddr, unsigned int len) override; #endif - void process_qsupported (char **features, int count) override; - bool supports_tracepoints () override; CORE_ADDR read_pc (regcache *regcache) override; diff --git a/gdbserver/linux-m32r-low.cc b/gdbserver/linux-m32r-low.cc index b82d5ab5132..25d971c1b90 100644 --- a/gdbserver/linux-m32r-low.cc +++ b/gdbserver/linux-m32r-low.cc @@ -163,7 +163,6 @@ m32r_target::get_regs_info () } struct linux_target_ops the_low_target = { - NULL, /* process_qsupported */ NULL, /* supports_tracepoints */ NULL, /* get_thread_area */ NULL, /* install_fast_tracepoint_jump_pad */ diff --git a/gdbserver/linux-m68k-low.cc b/gdbserver/linux-m68k-low.cc index 051dd4554ed..12c7a4d06af 100644 --- a/gdbserver/linux-m68k-low.cc +++ b/gdbserver/linux-m68k-low.cc @@ -259,7 +259,6 @@ m68k_supports_hardware_single_step (void) } struct linux_target_ops the_low_target = { - NULL, /* process_qsupported */ NULL, /* supports_tracepoints */ NULL, /* get_thread_area */ NULL, /* install_fast_tracepoint_jump_pad */ diff --git a/gdbserver/linux-ppc-low.cc b/gdbserver/linux-ppc-low.cc index 0561ab366f6..ba5eac3f9fb 100644 --- a/gdbserver/linux-ppc-low.cc +++ b/gdbserver/linux-ppc-low.cc @@ -3430,7 +3430,6 @@ ppc_get_ipa_tdesc_idx (void) } struct linux_target_ops the_low_target = { - NULL, /* process_qsupported */ ppc_supports_tracepoints, ppc_get_thread_area, ppc_install_fast_tracepoint_jump_pad, diff --git a/gdbserver/linux-s390-low.cc b/gdbserver/linux-s390-low.cc index 73b246e3134..8e0c5aae3f9 100644 --- a/gdbserver/linux-s390-low.cc +++ b/gdbserver/linux-s390-low.cc @@ -2839,7 +2839,6 @@ s390_emit_ops (void) } struct linux_target_ops the_low_target = { - NULL, /* process_qsupported */ s390_supports_tracepoints, s390_get_thread_area, s390_install_fast_tracepoint_jump_pad, diff --git a/gdbserver/linux-sh-low.cc b/gdbserver/linux-sh-low.cc index 03549d1bf78..df25935fd44 100644 --- a/gdbserver/linux-sh-low.cc +++ b/gdbserver/linux-sh-low.cc @@ -194,7 +194,6 @@ sh_target::low_arch_setup () } struct linux_target_ops the_low_target = { - NULL, /* process_qsupported */ NULL, /* supports_tracepoints */ NULL, /* get_thread_area */ NULL, /* install_fast_tracepoint_jump_pad */ diff --git a/gdbserver/linux-tic6x-low.cc b/gdbserver/linux-tic6x-low.cc index 62ff0da55b8..db6478a8025 100644 --- a/gdbserver/linux-tic6x-low.cc +++ b/gdbserver/linux-tic6x-low.cc @@ -425,7 +425,6 @@ tic6x_target::get_regs_info () } struct linux_target_ops the_low_target = { - NULL, /* process_qsupported */ NULL, /* supports_tracepoints */ NULL, /* get_thread_area */ NULL, /* install_fast_tracepoint_jump_pad */ diff --git a/gdbserver/linux-tile-low.cc b/gdbserver/linux-tile-low.cc index 99423fda832..637da14d856 100644 --- a/gdbserver/linux-tile-low.cc +++ b/gdbserver/linux-tile-low.cc @@ -226,7 +226,6 @@ tile_supports_hardware_single_step (void) struct linux_target_ops the_low_target = { - NULL, /* process_qsupported */ NULL, /* supports_tracepoints */ NULL, /* get_thread_area */ NULL, /* install_fast_tracepoint_jump_pad */ diff --git a/gdbserver/linux-x86-low.cc b/gdbserver/linux-x86-low.cc index b5eff688609..93e0a1425ae 100644 --- a/gdbserver/linux-x86-low.cc +++ b/gdbserver/linux-x86-low.cc @@ -102,16 +102,14 @@ public: x86_target () : linux_process_target (1) { } - /* Update all the target description of all processes; a new GDB - connected, and it may or not support xml target descriptions. */ - void update_xmltarget (); - const regs_info *get_regs_info () override; const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override; bool supports_z_point_type (char z_type) override; + void process_qsupported (char **features, int count) override; + protected: void low_arch_setup () override; @@ -157,6 +155,12 @@ protected: void low_new_fork (process_info *parent, process_info *child) override; void low_prepare_to_resume (lwp_info *lwp) override; + +private: + + /* Update all the target description of all processes; a new GDB + connected, and it may or not support xml target descriptions. */ + void update_xmltarget (); }; /* The singleton target ops object. */ @@ -994,8 +998,8 @@ x86_target::update_xmltarget () /* Process qSupported query, "xmlRegisters=". Update the buffer size for PTRACE_GETREGSET. */ -static void -x86_linux_process_qsupported (char **features, int count) +void +x86_target::process_qsupported (char **features, int count) { int i; @@ -1026,7 +1030,7 @@ x86_linux_process_qsupported (char **features, int count) free (copy); } } - the_x86_target.update_xmltarget (); + update_xmltarget (); } /* Common for x86/x86-64. */ @@ -2956,7 +2960,6 @@ x86_get_ipa_tdesc_idx (void) struct linux_target_ops the_low_target = { - x86_linux_process_qsupported, x86_supports_tracepoints, x86_get_thread_area, x86_install_fast_tracepoint_jump_pad, diff --git a/gdbserver/linux-xtensa-low.cc b/gdbserver/linux-xtensa-low.cc index 1c4db4cfaca..3e7211815f6 100644 --- a/gdbserver/linux-xtensa-low.cc +++ b/gdbserver/linux-xtensa-low.cc @@ -331,7 +331,6 @@ xtensa_target::get_regs_info () } struct linux_target_ops the_low_target = { - NULL, /* process_qsupported */ NULL, /* supports_tracepoints */ NULL, /* get_thread_area */ NULL, /* install_fast_tracepoint_jump_pad */