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

Remove the 'sw_breakpoint_from_kind' linux target op, and let
the concrete linux target define it by overriding the op
in process_stratum_target.

* linux-low.cc (linux_process_target::sw_breakpoint_from_kind):
Remove.
* linux-low.h (struct linux_target_ops): Remove the op.
(class linux_process_target) <sw_breakpoint_from_kind>: Remove.
* linux-x86-low.cc (class x86_target) <sw_breakpoint_from_kind>:
Declare.
(x86_sw_breakpoint_from_kind): Turn into...
(x86_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (class aarch64_target)
<sw_breakpoint_from_kind>: Declare.
(aarch64_sw_breakpoint_from_kind): Turn into...
(aarch64_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-arm-low.cc (class arm_target) <sw_breakpoint_from_kind>:
Declare.
(arm_target::sw_breakpoint_from_kind): Define.
(the_low_target): Remove the op field.
* linux-bfin-low.cc (class bfin_target) <sw_breakpoint_from_kind>:
Declare.
(bfin_sw_breakpoint_from_kind): Turn into...
(bfin_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-cris-low.cc (class cris_target) <sw_breakpoint_from_kind>:
Declare.
(cris_sw_breakpoint_from_kind): Turn into...
(cris_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-crisv32-low.cc (class crisv32_target)
<sw_breakpoint_from_kind>: Declare.
(cris_sw_breakpoint_from_kind): Turn into...
(crisv32_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-ia64-low.cc (class ia64_target) <sw_breakpoint_from_kind>:
Declare.
(ia64_target::sw_breakpoint_from_kind): Define.
* linux-m32r-low.cc (class m32r_target) <sw_breakpoint_from_kind>:
Declare.
(m32r_sw_breakpoint_from_kind): Turn into...
(m32r_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-m68k-low.cc (class m68k_target) <sw_breakpoint_from_kind>:
Declare.
(m68k_sw_breakpoint_from_kind): Turn into...
(m68k_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-mips-low.cc (class mips_target) <sw_breakpoint_from_kind>:
Declare.
(mips_sw_breakpoint_from_kind): Turn into...
(mips_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-nios2-low.cc (class nios2_target) <sw_breakpoint_from_kind>:
Declare.
(nios2_sw_breakpoint_from_kind): Turn into...
(nios2_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-ppc-low.cc (class ppc_target) <sw_breakpoint_from_kind>:
Declare.
(ppc_sw_breakpoint_from_kind): Turn into...
(ppc_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-riscv-low.cc (class riscv_target) <sw_breakpoint_from_kind>:
Declare.
(riscv_sw_breakpoint_from_kind): Turn into...
(riscv_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-s390-low.cc (class s390_target) <sw_breakpoint_from_kind>:
Declare.
(s390_sw_breakpoint_from_kind): Turn into...
(s390_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-sh-low.cc (class sh_target) <sw_breakpoint_from_kind>:
Declare.
(sh_sw_breakpoint_from_kind): Turn into...
(sh_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-sparc-low.cc (class sparc_target) <sw_breakpoint_from_kind>:
Declare.
(sparc_sw_breakpoint_from_kind): Turn into...
(sparc_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-tic6x-low.cc (class tic6x_target) <sw_breakpoint_from_kind>:
Declare.
(tic6x_sw_breakpoint_from_kind): Turn into...
(tic6x_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-tile-low.cc (class tile_target) <sw_breakpoint_from_kind>:
Declare.
(tile_sw_breakpoint_from_kind): Turn into...
(tile_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.
* linux-xtensa-low.cc (class xtensa_target)
<sw_breakpoint_from_kind>: Declare.
(xtensa_sw_breakpoint_from_kind): Turn into...
(xtensa_target::sw_breakpoint_from_kind): ...this.
(the_low_target): Remove the op field.

22 files changed:
gdbserver/ChangeLog
gdbserver/linux-aarch64-low.cc
gdbserver/linux-arm-low.cc
gdbserver/linux-bfin-low.cc
gdbserver/linux-cris-low.cc
gdbserver/linux-crisv32-low.cc
gdbserver/linux-ia64-low.cc
gdbserver/linux-low.cc
gdbserver/linux-low.h
gdbserver/linux-m32r-low.cc
gdbserver/linux-m68k-low.cc
gdbserver/linux-mips-low.cc
gdbserver/linux-nios2-low.cc
gdbserver/linux-ppc-low.cc
gdbserver/linux-riscv-low.cc
gdbserver/linux-s390-low.cc
gdbserver/linux-sh-low.cc
gdbserver/linux-sparc-low.cc
gdbserver/linux-tic6x-low.cc
gdbserver/linux-tile-low.cc
gdbserver/linux-x86-low.cc
gdbserver/linux-xtensa-low.cc

index d81641cc19749ff6d442ccb57831af57e095e204..77c766d8052a2d5034deb442ba5b1374447af659 100644 (file)
@@ -1,3 +1,106 @@
+2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
+
+       Remove the 'sw_breakpoint_from_kind' linux target op, and let
+       the concrete linux target define it by overriding the op
+       in process_stratum_target.
+
+       * linux-low.cc (linux_process_target::sw_breakpoint_from_kind):
+       Remove.
+       * linux-low.h (struct linux_target_ops): Remove the op.
+       (class linux_process_target) <sw_breakpoint_from_kind>: Remove.
+       * linux-x86-low.cc (class x86_target) <sw_breakpoint_from_kind>:
+       Declare.
+       (x86_sw_breakpoint_from_kind): Turn into...
+       (x86_target::sw_breakpoint_from_kind): ...this.
+       (the_low_target): Remove the op field.
+       * linux-aarch64-low.cc (class aarch64_target)
+       <sw_breakpoint_from_kind>: Declare.
+       (aarch64_sw_breakpoint_from_kind): Turn into...
+       (aarch64_target::sw_breakpoint_from_kind): ...this.
+       (the_low_target): Remove the op field.
+       * linux-arm-low.cc (class arm_target) <sw_breakpoint_from_kind>:
+       Declare.
+       (arm_target::sw_breakpoint_from_kind): Define.
+       (the_low_target): Remove the op field.
+       * linux-bfin-low.cc (class bfin_target) <sw_breakpoint_from_kind>:
+       Declare.
+       (bfin_sw_breakpoint_from_kind): Turn into...
+       (bfin_target::sw_breakpoint_from_kind): ...this.
+       (the_low_target): Remove the op field.
+       * linux-cris-low.cc (class cris_target) <sw_breakpoint_from_kind>:
+       Declare.
+       (cris_sw_breakpoint_from_kind): Turn into...
+       (cris_target::sw_breakpoint_from_kind): ...this.
+       (the_low_target): Remove the op field.
+       * linux-crisv32-low.cc (class crisv32_target)
+       <sw_breakpoint_from_kind>: Declare.
+       (cris_sw_breakpoint_from_kind): Turn into...
+       (crisv32_target::sw_breakpoint_from_kind): ...this.
+       (the_low_target): Remove the op field.
+       * linux-ia64-low.cc (class ia64_target) <sw_breakpoint_from_kind>:
+       Declare.
+       (ia64_target::sw_breakpoint_from_kind): Define.
+       * linux-m32r-low.cc (class m32r_target) <sw_breakpoint_from_kind>:
+       Declare.
+       (m32r_sw_breakpoint_from_kind): Turn into...
+       (m32r_target::sw_breakpoint_from_kind): ...this.
+       (the_low_target): Remove the op field.
+       * linux-m68k-low.cc (class m68k_target) <sw_breakpoint_from_kind>:
+       Declare.
+       (m68k_sw_breakpoint_from_kind): Turn into...
+       (m68k_target::sw_breakpoint_from_kind): ...this.
+       (the_low_target): Remove the op field.
+       * linux-mips-low.cc (class mips_target) <sw_breakpoint_from_kind>:
+       Declare.
+       (mips_sw_breakpoint_from_kind): Turn into...
+       (mips_target::sw_breakpoint_from_kind): ...this.
+       (the_low_target): Remove the op field.
+       * linux-nios2-low.cc (class nios2_target) <sw_breakpoint_from_kind>:
+       Declare.
+       (nios2_sw_breakpoint_from_kind): Turn into...
+       (nios2_target::sw_breakpoint_from_kind): ...this.
+       (the_low_target): Remove the op field.
+       * linux-ppc-low.cc (class ppc_target) <sw_breakpoint_from_kind>:
+       Declare.
+       (ppc_sw_breakpoint_from_kind): Turn into...
+       (ppc_target::sw_breakpoint_from_kind): ...this.
+       (the_low_target): Remove the op field.
+       * linux-riscv-low.cc (class riscv_target) <sw_breakpoint_from_kind>:
+       Declare.
+       (riscv_sw_breakpoint_from_kind): Turn into...
+       (riscv_target::sw_breakpoint_from_kind): ...this.
+       (the_low_target): Remove the op field.
+       * linux-s390-low.cc (class s390_target) <sw_breakpoint_from_kind>:
+       Declare.
+       (s390_sw_breakpoint_from_kind): Turn into...
+       (s390_target::sw_breakpoint_from_kind): ...this.
+       (the_low_target): Remove the op field.
+       * linux-sh-low.cc (class sh_target) <sw_breakpoint_from_kind>:
+       Declare.
+       (sh_sw_breakpoint_from_kind): Turn into...
+       (sh_target::sw_breakpoint_from_kind): ...this.
+       (the_low_target): Remove the op field.
+       * linux-sparc-low.cc (class sparc_target) <sw_breakpoint_from_kind>:
+       Declare.
+       (sparc_sw_breakpoint_from_kind): Turn into...
+       (sparc_target::sw_breakpoint_from_kind): ...this.
+       (the_low_target): Remove the op field.
+       * linux-tic6x-low.cc (class tic6x_target) <sw_breakpoint_from_kind>:
+       Declare.
+       (tic6x_sw_breakpoint_from_kind): Turn into...
+       (tic6x_target::sw_breakpoint_from_kind): ...this.
+       (the_low_target): Remove the op field.
+       * linux-tile-low.cc (class tile_target) <sw_breakpoint_from_kind>:
+       Declare.
+       (tile_sw_breakpoint_from_kind): Turn into...
+       (tile_target::sw_breakpoint_from_kind): ...this.
+       (the_low_target): Remove the op field.
+       * linux-xtensa-low.cc (class xtensa_target)
+       <sw_breakpoint_from_kind>: Declare.
+       (xtensa_sw_breakpoint_from_kind): Turn into...
+       (xtensa_target::sw_breakpoint_from_kind): ...this.
+       (the_low_target): Remove the op field.
+
 2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
 
        Remove the 'breakpoint_kind_from_pc' and
index c9c9b30b36fdcb271acc2f93ac34983a4ab676c8..23c9c3e25184ce83ae42d911ccecdb964f537766 100644 (file)
@@ -61,6 +61,8 @@ public:
 
   int breakpoint_kind_from_current_state (CORE_ADDR *pcptr) override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -3054,10 +3056,10 @@ aarch64_supports_range_stepping (void)
   return 1;
 }
 
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
+/* Implementation of target ops method "sw_breakpoint_from_kind".  */
 
-static const gdb_byte *
-aarch64_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+aarch64_target::sw_breakpoint_from_kind (int kind, int *size)
 {
   if (is_64bit_tdesc ())
     {
@@ -3101,7 +3103,6 @@ aarch64_supports_hardware_single_step (void)
 
 struct linux_target_ops the_low_target =
 {
-  aarch64_sw_breakpoint_from_kind,
   NULL, /* get_next_pcs */
   0,    /* decr_pc_after_break */
   aarch64_breakpoint_at,
index d02ead70fa9d0e7987ab90524a37cac27f12989f..aab2c427f5abd4b446de5b0d3a6862ddf3c7319c 100644 (file)
@@ -66,6 +66,8 @@ public:
 
   int breakpoint_kind_from_current_state (CORE_ADDR *pcptr) override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -115,6 +117,12 @@ arm_target::breakpoint_kind_from_current_state (CORE_ADDR *pcptr)
   return arm_breakpoint_kind_from_current_state (pcptr);
 }
 
+const gdb_byte *
+arm_target::sw_breakpoint_from_kind (int kind, int *size)
+{
+  return arm_sw_breakpoint_from_kind (kind, size);
+}
+
 /* Information describing the hardware breakpoint capabilities.  */
 static struct
 {
@@ -1067,7 +1075,6 @@ arm_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  arm_sw_breakpoint_from_kind,
   arm_gdbserver_get_next_pcs,
   0,
   arm_breakpoint_at,
index 1a0938ef5846e1a968ed33ccfa856c9b6af80ad7..c798c9317f26d570cca196ef4751b8b1630888d7 100644 (file)
@@ -31,6 +31,8 @@ public:
 
   const regs_info *get_regs_info () override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -102,10 +104,10 @@ bfin_target::low_cannot_fetch_register (int regno)
 #define bfin_breakpoint_len 2
 static const gdb_byte bfin_breakpoint[bfin_breakpoint_len] = {0xa1, 0x00};
 
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
+/* Implementation of target ops method "sw_breakpoint_from_kind".  */
 
-static const gdb_byte *
-bfin_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+bfin_target::sw_breakpoint_from_kind (int kind, int *size)
 {
   *size = bfin_breakpoint_len;
   return bfin_breakpoint;
@@ -159,7 +161,6 @@ bfin_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  bfin_sw_breakpoint_from_kind,
   NULL, /* get_next_pcs */
   2,
   bfin_breakpoint_at,
index 882e4c61eb09c9fe0cfde427f07981130448ced3..a22ec3342dcae1d0976f1e517abd046c2d236c2d 100644 (file)
@@ -28,6 +28,8 @@ public:
 
   const regs_info *get_regs_info () override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -107,10 +109,10 @@ cris_target::low_cannot_fetch_register (int regno)
 static const unsigned short cris_breakpoint = 0xe938;
 #define cris_breakpoint_len 2
 
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
+/* Implementation of target ops method "sw_breakpoint_from_kind".  */
 
-static const gdb_byte *
-cris_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+cris_target::sw_breakpoint_from_kind (int kind, int *size)
 {
   *size = cris_breakpoint_len;
   return (const gdb_byte *) &cris_breakpoint;
@@ -156,7 +158,6 @@ cris_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  cris_sw_breakpoint_from_kind,
   NULL, /* get_next_pcs */
   0,
   cris_breakpoint_at,
index 270c206e8062e4a547ecdd06b1bbe9afcabb1d03..965f186981d9eacc07486d56f1384cea0b8ae902 100644 (file)
@@ -28,6 +28,8 @@ public:
 
   const regs_info *get_regs_info () override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -117,10 +119,10 @@ static int cris_regmap[] = {
 static const unsigned short cris_breakpoint = 0xe938;
 #define cris_breakpoint_len 2
 
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
+/* Implementation of target ops method "sw_breakpoint_from_kind".  */
 
-static const gdb_byte *
-cris_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+crisv32_target::sw_breakpoint_from_kind (int kind, int *size)
 {
   *size = cris_breakpoint_len;
   return (const gdb_byte *) &cris_breakpoint;
@@ -453,7 +455,6 @@ crisv32_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  cris_sw_breakpoint_from_kind,
   NULL, /* get_next_pcs */
   0,
   cris_breakpoint_at,
index 377df4f75c307d1473dc32cb307da0258c2e203e..493c7e4f93d6fd20da2016bfa0fb84f1ae4b14b4 100644 (file)
@@ -31,6 +31,8 @@ public:
 
   const regs_info *get_regs_info () override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -46,6 +48,13 @@ protected:
 
 static ia64_target the_ia64_target;
 
+const gdb_byte *
+ia64_target::sw_breakpoint_from_kind (int kind, int *size)
+{
+  gdb_assert_no_reached ("target op sw_breakpoint_from_kind is not "
+                        "implemented by this target");
+}
+
 /* Defined in auto-generated file reg-ia64.c.  */
 void init_registers_ia64 (void);
 extern const struct target_desc *tdesc_ia64;
index 730f23bb6f034311febbe7fe6eaad047fa4af81f..14a4dbf0866a2c4bf27d58dcf2087e5e7cc1a597 100644 (file)
@@ -7230,16 +7230,6 @@ current_lwp_ptid (void)
   return ptid_of (current_thread);
 }
 
-/* Implementation of the target_ops method "sw_breakpoint_from_kind".  */
-
-const gdb_byte *
-linux_process_target::sw_breakpoint_from_kind (int kind, int *size)
-{
-  gdb_assert (the_low_target.sw_breakpoint_from_kind != NULL);
-
-  return (*the_low_target.sw_breakpoint_from_kind) (kind, size);
-}
-
 const char *
 linux_process_target::thread_name (ptid_t thread)
 {
index 60ec910057f2e2a4d0fb024a807070520eaca864..b2f779893e30fe08e4283b83744edf64311cfa66 100644 (file)
@@ -131,9 +131,6 @@ struct lwp_info;
 
 struct linux_target_ops
 {
-  /* See target.h for details.  */
-  const gdb_byte *(*sw_breakpoint_from_kind) (int kind, int *size);
-
   /* Find the next possible PCs after the current instruction executes.  */
   std::vector<CORE_ADDR> (*get_next_pcs) (struct regcache *regcache);
 
@@ -436,8 +433,6 @@ public:
   ssize_t multifs_readlink (int pid, const char *filename, char *buf,
                            size_t bufsiz) override;
 
-  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
-
   const char *thread_name (ptid_t thread) override;
 
 #if USE_THREAD_DB
index c7bb811e64cf14030486b98bf913560ba17adac7..1a6771f5845c54497afea64df78915ae8337d738 100644 (file)
@@ -31,6 +31,8 @@ public:
 
   const regs_info *get_regs_info () override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -101,10 +103,10 @@ m32r_target::low_cannot_fetch_register (int regno)
 static const unsigned short m32r_breakpoint = 0x10f1;
 #define m32r_breakpoint_len 2
 
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
+/* Implementation of target ops method "sw_breakpoint_from_kind".  */
 
-static const gdb_byte *
-m32r_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+m32r_target::sw_breakpoint_from_kind (int kind, int *size)
 {
   *size = m32r_breakpoint_len;
   return (const gdb_byte *) &m32r_breakpoint;
@@ -158,7 +160,6 @@ m32r_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  m32r_sw_breakpoint_from_kind,
   NULL,
   0,
   m32r_breakpoint_at,
index 6483c27698e082a9daaa38c4d847e128aad0008a..5e19ab02094d459927596bbaf667e9f426150802 100644 (file)
@@ -27,6 +27,8 @@ public:
 
   const regs_info *get_regs_info () override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -170,10 +172,10 @@ static struct regset_info m68k_regsets[] = {
 static const gdb_byte m68k_breakpoint[] = { 0x4E, 0x4F };
 #define m68k_breakpoint_len 2
 
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
+/* Implementation of target ops method "sw_breakpoint_from_kind".  */
 
-static const gdb_byte *
-m68k_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+m68k_target::sw_breakpoint_from_kind (int kind, int *size)
 {
   *size = m68k_breakpoint_len;
   return m68k_breakpoint;
@@ -253,7 +255,6 @@ m68k_supports_hardware_single_step (void)
 }
 
 struct linux_target_ops the_low_target = {
-  m68k_sw_breakpoint_from_kind,
   NULL,
   2,
   m68k_breakpoint_at,
index d36836669dbd72af3a6ccd84c83c4f6b24dc0a1b..972f431bfbd8931de61e55d716b615febd886b71 100644 (file)
@@ -33,6 +33,8 @@ public:
 
   const regs_info *get_regs_info () override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -315,10 +317,10 @@ mips_target::low_set_pc (regcache *regcache, CORE_ADDR pc)
 static const unsigned int mips_breakpoint = 0x0005000d;
 #define mips_breakpoint_len 4
 
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
+/* Implementation of target ops method "sw_breakpoint_from_kind".  */
 
-static const gdb_byte *
-mips_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+mips_target::sw_breakpoint_from_kind (int kind, int *size)
 {
   *size = mips_breakpoint_len;
   return (const gdb_byte *) &mips_breakpoint;
@@ -964,7 +966,6 @@ mips_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  mips_sw_breakpoint_from_kind,
   NULL, /* get_next_pcs */
   0,
   mips_breakpoint_at,
index 4f10df53d205efc7e1773627ce6ba566bac06739..693af71f29ec3daa416f55df4821520e640d3136 100644 (file)
@@ -39,6 +39,8 @@ public:
 
   const regs_info *get_regs_info () override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -152,10 +154,10 @@ nios2_target::low_cannot_store_register (int regno)
 static const unsigned int nios2_breakpoint = NIOS2_BREAKPOINT;
 #define nios2_breakpoint_len 4
 
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
+/* Implementation of target ops method "sw_breakpoint_from_kind".  */
 
-static const gdb_byte *
-nios2_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+nios2_target::sw_breakpoint_from_kind (int kind, int *size)
 {
   *size = nios2_breakpoint_len;
   return (const gdb_byte *) &nios2_breakpoint;
@@ -275,7 +277,6 @@ nios2_target::get_regs_info ()
 
 struct linux_target_ops the_low_target =
 {
-  nios2_sw_breakpoint_from_kind,
   NULL, /* get_next_pcs */
   0,
   nios2_breakpoint_at,
index 167c3b60f761542ed892b32e0d7dc3398a16f838..9690d79f3d87360c5c3869b58885689ca7767dbb 100644 (file)
@@ -52,6 +52,8 @@ public:
 
   const regs_info *get_regs_info () override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -296,10 +298,10 @@ static int ppc_regmap_adjusted;
 static const unsigned int ppc_breakpoint = 0x7d821008;
 #define ppc_breakpoint_len 4
 
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
+/* Implementation of target ops method "sw_breakpoint_from_kind".  */
 
-static const gdb_byte *
-ppc_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+ppc_target::sw_breakpoint_from_kind (int kind, int *size)
 {
   *size = ppc_breakpoint_len;
   return (const gdb_byte *) &ppc_breakpoint;
@@ -3404,7 +3406,6 @@ ppc_get_ipa_tdesc_idx (void)
 }
 
 struct linux_target_ops the_low_target = {
-  ppc_sw_breakpoint_from_kind,
   NULL,
   0,
   ppc_breakpoint_at,
index 87266395e96b3bbcdd61b661dc56045b06b1340b..d6f31b47250cd8b02b9e4b1158785aa63115182a 100644 (file)
@@ -40,6 +40,8 @@ public:
 
   int breakpoint_kind_from_pc (CORE_ADDR *pcptr) override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -266,10 +268,10 @@ riscv_target::breakpoint_kind_from_pc (CORE_ADDR *pcptr)
     return sizeof (riscv_cbreakpoint);
 }
 
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
+/* Implementation of target ops method "sw_breakpoint_from_kind".  */
 
-static const gdb_byte *
-riscv_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+riscv_target::sw_breakpoint_from_kind (int kind, int *size)
 {
   *size = kind;
   switch (kind)
@@ -307,7 +309,6 @@ riscv_breakpoint_at (CORE_ADDR pc)
 /* RISC-V/Linux target operations.  */
 struct linux_target_ops the_low_target =
 {
-  riscv_sw_breakpoint_from_kind,
   NULL, /* get_next_pcs */
   0,    /* decr_pc_after_break */
   riscv_breakpoint_at,
index 44f3be6c98e52c32b1eeaca4c32257c30de8fbd8..164142dff6e81fddcd34c3cdc666c6ca7542f200 100644 (file)
@@ -59,6 +59,8 @@ public:
 
   const regs_info *get_regs_info () override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -451,10 +453,10 @@ static struct regset_info s390_regsets[] = {
 static const gdb_byte s390_breakpoint[] = { 0, 1 };
 #define s390_breakpoint_len 2
 
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
+/* Implementation of target ops method "sw_breakpoint_from_kind".  */
 
-static const gdb_byte *
-s390_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+s390_target::sw_breakpoint_from_kind (int kind, int *size)
 {
   *size = s390_breakpoint_len;
   return s390_breakpoint;
@@ -2824,7 +2826,6 @@ s390_emit_ops (void)
 }
 
 struct linux_target_ops the_low_target = {
-  s390_sw_breakpoint_from_kind,
   NULL,
   s390_breakpoint_len,
   s390_breakpoint_at,
index 36c193347580793e3f12c69a345a7891aecb7541..10ee49a5f87118ddd5c5236c8217ee7b31510243 100644 (file)
@@ -27,6 +27,8 @@ public:
 
   const regs_info *get_regs_info () override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -107,10 +109,10 @@ sh_target::low_cannot_fetch_register (int regno)
 static const unsigned short sh_breakpoint = 0xc3c3;
 #define sh_breakpoint_len 2
 
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
+/* Implementation of target ops method "sw_breakpoint_from_kind".  */
 
-static const gdb_byte *
-sh_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+sh_target::sw_breakpoint_from_kind (int kind, int *size)
 {
   *size = sh_breakpoint_len;
   return (const gdb_byte *) &sh_breakpoint;
@@ -188,7 +190,6 @@ sh_target::low_arch_setup ()
 }
 
 struct linux_target_ops the_low_target = {
-  sh_sw_breakpoint_from_kind,
   NULL,
   0,
   sh_breakpoint_at,
index 18a529adb70255942c3930b93d9c59e6b33d506a..c94c3e3caf3b65fe02680d5724b185529916549f 100644 (file)
@@ -50,6 +50,8 @@ public:
 
   const regs_info *get_regs_info () override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -267,10 +269,10 @@ static const gdb_byte sparc_breakpoint[INSN_SIZE] = {
 };
 #define sparc_breakpoint_len INSN_SIZE
 
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
+/* Implementation of target ops method "sw_breakpoint_from_kind".  */
 
-static const unsigned char *
-sparc_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+sparc_target::sw_breakpoint_from_kind (int kind, int *size)
 {
   *size = sparc_breakpoint_len;
   return sparc_breakpoint;
@@ -337,7 +339,6 @@ sparc_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  sparc_sw_breakpoint_from_kind,
   NULL, /* get_next_pcs */
   0,
   sparc_breakpoint_at,
index 1486829594d6aa4d9262e4854d235deec5590a6a..69bb4f3d7b1e63ca985edfa85d8289de126d9bb3 100644 (file)
@@ -46,6 +46,8 @@ public:
 
   const regs_info *get_regs_info () override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -202,10 +204,10 @@ static int *tic6x_regmap;
 static unsigned int tic6x_breakpoint;
 #define tic6x_breakpoint_len 4
 
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
+/* Implementation of target ops method "sw_breakpoint_from_kind".  */
 
-static const gdb_byte *
-tic6x_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+tic6x_target::sw_breakpoint_from_kind (int kind, int *size)
 {
   *size = tic6x_breakpoint_len;
   return (const gdb_byte *) &tic6x_breakpoint;
@@ -419,7 +421,6 @@ tic6x_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  tic6x_sw_breakpoint_from_kind,
   NULL,
   0,
   tic6x_breakpoint_at,
index d577b589b4ae0d1ee205e01d3bd1f69e9135c526..e4565b4cfbecc86169996cc853bb5b68fbb889a6 100644 (file)
@@ -31,6 +31,8 @@ public:
 
   const regs_info *get_regs_info () override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -116,10 +118,10 @@ tile_target::low_cannot_store_register (int regno)
 static uint64_t tile_breakpoint = 0x400b3cae70166000ULL;
 #define tile_breakpoint_len 8
 
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
+/* Implementation of target ops method "sw_breakpoint_from_kind".  */
 
-static const gdb_byte *
-tile_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+tile_target::sw_breakpoint_from_kind (int kind, int *size)
 {
   *size = tile_breakpoint_len;
   return (const gdb_byte *) &tile_breakpoint;
@@ -220,7 +222,6 @@ tile_supports_hardware_single_step (void)
 
 struct linux_target_ops the_low_target =
 {
-  tile_sw_breakpoint_from_kind,
   NULL,
   0,
   tile_breakpoint_at,
index 1da48db30272798dafabe0de65fa8cc7ece32f7c..a9d7ec06705d1db5c832ae2f5d8a2214c40d5207 100644 (file)
@@ -106,6 +106,8 @@ public:
 
   const regs_info *get_regs_info () override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -2852,10 +2854,10 @@ x86_emit_ops (void)
     return &i386_emit_ops;
 }
 
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
+/* Implementation of target ops method "sw_breakpoint_from_kind".  */
 
-static const gdb_byte *
-x86_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+x86_target::sw_breakpoint_from_kind (int kind, int *size)
 {
   *size = x86_breakpoint_len;
   return x86_breakpoint;
@@ -2897,7 +2899,6 @@ x86_get_ipa_tdesc_idx (void)
 
 struct linux_target_ops the_low_target =
 {
-  x86_sw_breakpoint_from_kind,
   NULL,
   1,
   x86_breakpoint_at,
index 32643307cb7b76980915ab44bc9df2fc3916a16f..ab08227a862b28ae22dd4d8ef13245a284971abe 100644 (file)
@@ -28,6 +28,8 @@ public:
 
   const regs_info *get_regs_info () override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -252,10 +254,10 @@ static struct regset_info xtensa_regsets[] = {
 static const gdb_byte xtensa_breakpoint[] = XTENSA_BREAKPOINT;
 #define xtensa_breakpoint_len 2
 
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
+/* Implementation of target ops method "sw_breakpoint_from_kind".  */
 
-static const gdb_byte *
-xtensa_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+xtensa_target::sw_breakpoint_from_kind (int kind, int *size)
 {
   *size = xtensa_breakpoint_len;
   return xtensa_breakpoint;
@@ -326,7 +328,6 @@ xtensa_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  xtensa_sw_breakpoint_from_kind,
   NULL,
   0,
   xtensa_breakpoint_at,
This page took 0.046978 seconds and 4 git commands to generate.