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

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) <process_qsupported>: Remove.
* linux-low.cc (linux_process_target::process_qsupported): Remove.
* linux-x86-low.cc (class x86_target) <process_qsupported>: 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.

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 8c5ca79f1551da7399e50b1a8f44efa9bab4a9a2..e42b3d843907856a3278225d75d3ce4d7918df78 100644 (file)
@@ -1,3 +1,30 @@
+2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
+
+       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) <process_qsupported>: Remove.
+       * linux-low.cc (linux_process_target::process_qsupported): Remove.
+       * linux-x86-low.cc (class x86_target) <process_qsupported>: 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.
+
 2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
 
        Turn the 'prepare_to_resume' linux target op into a method of
index a99b97929cf7d1f9d02f79791f2b0a3fa6cf0bf4..56bf027b888b1769fbebb8acefeea31076f7e5f8 100644 (file)
@@ -3147,7 +3147,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,
index f6429f0475c420dde8a166efd1cf906cde58f711..9e74b03df07bbad325237cbdcafcae679c9728be 100644 (file)
@@ -1117,7 +1117,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 */
index 3e3f39a1ba5822fec8b26cec15615d57bde7e436..aa8a16e1d168840dd017a2ab816ce3eb3b3172ad 100644 (file)
@@ -171,7 +171,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 */
index d262fae9a950fb73fd9d94ee6223937eaa7cad82..f0851cabedd98fa3f8dbe1172401df894936393a 100644 (file)
@@ -468,7 +468,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 */
index 3105db6d01225063543b3e9985da1b37f5b9ca5d..e94118bd80037d21bc823f985a59947295c216e2 100644 (file)
@@ -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 ()
 {
index 49fbc5edcec85c34a2f505fcba2c559131a7b61d..bc45e3fbcb5bdc085e557888352e16bcdb83a8cb 100644 (file)
@@ -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);
 
@@ -299,8 +296,6 @@ public:
                    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;
index bae0f25e1830872d4f53584d9984a80548495e3f..3ba2b0ea5eec410899eac9f601943e0a4dd75d75 100644 (file)
@@ -161,7 +161,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 */
index cfb0a0ac2bfffa077deda660d6634d6669135f93..4f9b68b8eefa0e16f4330f2d4e96923d11b26b02 100644 (file)
@@ -265,7 +265,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 */
index 22fda3306f29e755ab1b64a43b17d0b592f069fc..0c3d5eb9897c07ce693bf9433fd4c4642495bf3f 100644 (file)
@@ -3428,7 +3428,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,
index e46375f59c4f7d408f132d187f5b6e4fce339a28..d3be399315cd140357bf26669ca54b7ca31f87de 100644 (file)
@@ -2845,7 +2845,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,
index d2d0f0b0958a634c9246852702c3fa2e0584b4e0..ac6b1d7b1c15d90798c3518ad1b845bccaa6a2dc 100644 (file)
@@ -192,7 +192,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 */
index ddb84e7517ed708dae724b34a5b8824ee15a3407..bf7099bf7fc5a81d061f5b688ecd30f66cd96bf5 100644 (file)
@@ -423,7 +423,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 */
index 5268f40ccf13d64a2bc3e61f4914a7abddf50393..355657bf95ec3d7ebcd48ed605cbc96b8b1e6130 100644 (file)
@@ -224,7 +224,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 */
index f9459dc18cb31e19b6de581d22fe74a7cfbb032f..bf5245e5b2d75a1baa15086a3e314f9b97f9553f 100644 (file)
@@ -100,16 +100,14 @@ class x86_target : public linux_process_target
 {
 public:
 
-  /* 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.  */
@@ -1001,8 +1005,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;
 
@@ -1033,7 +1037,7 @@ x86_linux_process_qsupported (char **features, int count)
          free (copy);
        }
     }
-  the_x86_target.update_xmltarget ();
+  update_xmltarget ();
 }
 
 /* Common for x86/x86-64.  */
@@ -2963,7 +2967,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,
index a58a74b98d5d53907570d5369ea1c31f7a0bfcc5..b6d0889e99879b452194b33e1a3d8781169fc292 100644 (file)
@@ -329,7 +329,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 */