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

Turn the 'breakpoint_at' linux target op into a method of
linux_process_target.

* linux-low.h (struct linux_target_ops): Remove the op.
(class linux_process_target) <low_breakpoint_at>: Declare.

Update the callers below:

* linux-low.cc (linux_process_target::save_stop_reason)
(linux_process_target::thread_still_has_status_pending)
(linux_process_target::wait_1)

* linux-x86-low.cc (class x86_target)
<low_breakpoint_at>: Declare.
(x86_breakpoint_at): Turn into...
(x86_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (class aarch64_target)
<low_breakpoint_at>: Declare.
(aarch64_breakpoint_at): Turn into...
(aarch64_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-arm-low.cc (class arm_target)
<low_breakpoint_at>: Declare.
(arm_target::low_breakpoint_at): Define.
(the_low_target): Remove the op field.
* linux-bfin-low.cc (class bfin_target)
<low_breakpoint_at>: Declare.
(bfin_breakpoint_at): Turn into...
(bfin_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-cris-low.cc (class cris_target)
<low_breakpoint_at>: Declare.
(cris_breakpoint_at): Turn into...
(cris_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-crisv32-low.cc (class crisv32_target)
<low_breakpoint_at>: Declare.
(crisv32_breakpoint_at): Turn into...
(crisv32_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-ia64-low.cc (class ia64_target)
<low_breakpoint_at>: Declare.
(ia64_target::low_breakpoint_at): Define.
* linux-m32r-low.cc (class m32r_target)
<low_breakpoint_at>: Declare.
(m32r_breakpoint_at): Turn into...
(m32r_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-m68k-low.cc (class m68k_target)
<low_breakpoint_at>: Declare.
(m68k_breakpoint_at): Turn into...
(m68k_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-mips-low.cc (class mips_target)
<low_breakpoint_at>: Declare.
(mips_breakpoint_at): Turn into...
(mips_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-nios2-low.cc (class nios2_target)
<low_breakpoint_at>: Declare.
(nios2_breakpoint_at): Turn into...
(nios2_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-ppc-low.cc (class ppc_target)
<low_breakpoint_at>: Declare.
(ppc_breakpoint_at): Turn into...
(ppc_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-riscv-low.cc (class riscv_target)
<low_breakpoint_at>: Declare.
(riscv_breakpoint_at): Turn into...
(riscv_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-s390-low.cc (class s390_target)
<low_breakpoint_at>: Declare.
(s390_breakpoint_at): Turn into...
(s390_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-sh-low.cc (class sh_target)
<low_breakpoint_at>: Declare.
(sh_breakpoint_at): Turn into...
(sh_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-sparc-low.cc (class sparc_target)
<low_breakpoint_at>: Declare.
(sparc_breakpoint_at): Turn into...
(sparc_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-tic6x-low.cc (class tic6x_target)
<low_breakpoint_at>: Declare.
(tic6x_breakpoint_at): Turn into...
(tic6x_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-tile-low.cc (class tile_target)
<low_breakpoint_at>: Declare.
(tile_breakpoint_at): Turn into...
(tile_target::low_breakpoint_at): ...this.
(the_low_target): Remove the op field.
* linux-xtensa-low.cc (class xtensa_target)
<low_breakpoint_at>: Declare.
(xtensa_breakpoint_at): Turn into...
(xtensa_target::low_breakpoint_at): ...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 4fc0609e48acf727240b88ac994c37bab421432f..1750dbf511041730e7dce35c7e64960731b71178 100644 (file)
@@ -1,3 +1,110 @@
+2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
+
+       Turn the 'breakpoint_at' linux target op into a method of
+       linux_process_target.
+
+       * linux-low.h (struct linux_target_ops): Remove the op.
+       (class linux_process_target) <low_breakpoint_at>: Declare.
+
+       Update the callers below:
+
+       * linux-low.cc (linux_process_target::save_stop_reason)
+       (linux_process_target::thread_still_has_status_pending)
+       (linux_process_target::wait_1)
+
+       * linux-x86-low.cc (class x86_target)
+       <low_breakpoint_at>: Declare.
+       (x86_breakpoint_at): Turn into...
+       (x86_target::low_breakpoint_at): ...this.
+       (the_low_target): Remove the op field.
+       * linux-aarch64-low.cc (class aarch64_target)
+       <low_breakpoint_at>: Declare.
+       (aarch64_breakpoint_at): Turn into...
+       (aarch64_target::low_breakpoint_at): ...this.
+       (the_low_target): Remove the op field.
+       * linux-arm-low.cc (class arm_target)
+       <low_breakpoint_at>: Declare.
+       (arm_target::low_breakpoint_at): Define.
+       (the_low_target): Remove the op field.
+       * linux-bfin-low.cc (class bfin_target)
+       <low_breakpoint_at>: Declare.
+       (bfin_breakpoint_at): Turn into...
+       (bfin_target::low_breakpoint_at): ...this.
+       (the_low_target): Remove the op field.
+       * linux-cris-low.cc (class cris_target)
+       <low_breakpoint_at>: Declare.
+       (cris_breakpoint_at): Turn into...
+       (cris_target::low_breakpoint_at): ...this.
+       (the_low_target): Remove the op field.
+       * linux-crisv32-low.cc (class crisv32_target)
+       <low_breakpoint_at>: Declare.
+       (crisv32_breakpoint_at): Turn into...
+       (crisv32_target::low_breakpoint_at): ...this.
+       (the_low_target): Remove the op field.
+       * linux-ia64-low.cc (class ia64_target)
+       <low_breakpoint_at>: Declare.
+       (ia64_target::low_breakpoint_at): Define.
+       * linux-m32r-low.cc (class m32r_target)
+       <low_breakpoint_at>: Declare.
+       (m32r_breakpoint_at): Turn into...
+       (m32r_target::low_breakpoint_at): ...this.
+       (the_low_target): Remove the op field.
+       * linux-m68k-low.cc (class m68k_target)
+       <low_breakpoint_at>: Declare.
+       (m68k_breakpoint_at): Turn into...
+       (m68k_target::low_breakpoint_at): ...this.
+       (the_low_target): Remove the op field.
+       * linux-mips-low.cc (class mips_target)
+       <low_breakpoint_at>: Declare.
+       (mips_breakpoint_at): Turn into...
+       (mips_target::low_breakpoint_at): ...this.
+       (the_low_target): Remove the op field.
+       * linux-nios2-low.cc (class nios2_target)
+       <low_breakpoint_at>: Declare.
+       (nios2_breakpoint_at): Turn into...
+       (nios2_target::low_breakpoint_at): ...this.
+       (the_low_target): Remove the op field.
+       * linux-ppc-low.cc (class ppc_target)
+       <low_breakpoint_at>: Declare.
+       (ppc_breakpoint_at): Turn into...
+       (ppc_target::low_breakpoint_at): ...this.
+       (the_low_target): Remove the op field.
+       * linux-riscv-low.cc (class riscv_target)
+       <low_breakpoint_at>: Declare.
+       (riscv_breakpoint_at): Turn into...
+       (riscv_target::low_breakpoint_at): ...this.
+       (the_low_target): Remove the op field.
+       * linux-s390-low.cc (class s390_target)
+       <low_breakpoint_at>: Declare.
+       (s390_breakpoint_at): Turn into...
+       (s390_target::low_breakpoint_at): ...this.
+       (the_low_target): Remove the op field.
+       * linux-sh-low.cc (class sh_target)
+       <low_breakpoint_at>: Declare.
+       (sh_breakpoint_at): Turn into...
+       (sh_target::low_breakpoint_at): ...this.
+       (the_low_target): Remove the op field.
+       * linux-sparc-low.cc (class sparc_target)
+       <low_breakpoint_at>: Declare.
+       (sparc_breakpoint_at): Turn into...
+       (sparc_target::low_breakpoint_at): ...this.
+       (the_low_target): Remove the op field.
+       * linux-tic6x-low.cc (class tic6x_target)
+       <low_breakpoint_at>: Declare.
+       (tic6x_breakpoint_at): Turn into...
+       (tic6x_target::low_breakpoint_at): ...this.
+       (the_low_target): Remove the op field.
+       * linux-tile-low.cc (class tile_target)
+       <low_breakpoint_at>: Declare.
+       (tile_breakpoint_at): Turn into...
+       (tile_target::low_breakpoint_at): ...this.
+       (the_low_target): Remove the op field.
+       * linux-xtensa-low.cc (class xtensa_target)
+       <low_breakpoint_at>: Declare.
+       (xtensa_breakpoint_at): Turn into...
+       (xtensa_target::low_breakpoint_at): ...this.
+       (the_low_target): Remove the op field.
+
 2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
 
        Turn the 'decr_pc_after_break' linux_target_ops field into
index 988aa939145c9d1ab80209466cf5f6ca223e3bdf..2fc38748e1becaa7e429c6cbbd825a66b96fca34 100644 (file)
@@ -76,6 +76,8 @@ protected:
   CORE_ADDR low_get_pc (regcache *regcache) override;
 
   void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -236,21 +238,20 @@ aarch64_target::low_set_pc (regcache *regcache, CORE_ADDR pc)
    (aarch64_default_breakpoint).  */
 static const gdb_byte aarch64_breakpoint[] = {0x00, 0x00, 0x20, 0xd4};
 
-/* Implementation of linux_target_ops method "breakpoint_at".  */
+/* Implementation of linux target ops method "low_breakpoint_at".  */
 
-static int
-aarch64_breakpoint_at (CORE_ADDR where)
+bool
+aarch64_target::low_breakpoint_at (CORE_ADDR where)
 {
   if (is_64bit_tdesc ())
     {
       gdb_byte insn[aarch64_breakpoint_len];
 
-      the_target->read_memory (where, (unsigned char *) &insn,
-                              aarch64_breakpoint_len);
+      read_memory (where, (unsigned char *) &insn, aarch64_breakpoint_len);
       if (memcmp (insn, aarch64_breakpoint, aarch64_breakpoint_len) == 0)
-       return 1;
+       return true;
 
-      return 0;
+      return false;
     }
   else
     return arm_breakpoint_at (where);
@@ -3103,7 +3104,6 @@ aarch64_supports_hardware_single_step (void)
 
 struct linux_target_ops the_low_target =
 {
-  aarch64_breakpoint_at,
   aarch64_supports_z_point_type,
   aarch64_insert_point,
   aarch64_remove_point,
index 18f427245c1d33baa54a4938e4a3d374ee36bebb..afbe0beca62380e45fdfd21b554ec66f8562bf06 100644 (file)
@@ -85,6 +85,8 @@ protected:
   void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
 
   std::vector<CORE_ADDR> low_get_next_pcs (regcache *regcache) override;
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -127,6 +129,12 @@ arm_target::sw_breakpoint_from_kind (int kind, int *size)
   return arm_sw_breakpoint_from_kind (kind, size);
 }
 
+bool
+arm_target::low_breakpoint_at (CORE_ADDR pc)
+{
+  return arm_breakpoint_at (pc);
+}
+
 /* Information describing the hardware breakpoint capabilities.  */
 static struct
 {
@@ -1085,7 +1093,6 @@ arm_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  arm_breakpoint_at,
   arm_supports_z_point_type,
   arm_insert_point,
   arm_remove_point,
index 23d0342c0dbcd8c6bc024f558c408cd99df9e087..351c7ae5c973fe1fef6322bef75475649953cd18 100644 (file)
@@ -48,6 +48,8 @@ protected:
   void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
 
   int low_decr_pc_after_break () override;
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -121,19 +123,19 @@ bfin_target::sw_breakpoint_from_kind (int kind, int *size)
   return bfin_breakpoint;
 }
 
-static int
-bfin_breakpoint_at (CORE_ADDR where)
+bool
+bfin_target::low_breakpoint_at (CORE_ADDR where)
 {
   unsigned char insn[bfin_breakpoint_len];
 
   read_inferior_memory(where, insn, bfin_breakpoint_len);
   if (insn[0] == bfin_breakpoint[0]
       && insn[1] == bfin_breakpoint[1])
-    return 1;
+    return true;
 
   /* If necessary, recognize more trap instructions here.  GDB only uses the
      one.  */
-  return 0;
+  return false;
 }
 
 void
@@ -169,7 +171,6 @@ bfin_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  bfin_breakpoint_at,
   NULL, /* supports_z_point_type */
   NULL, /* insert_point */
   NULL, /* remove_point */
index 5fb40bf1c3644958a9a5857acb2e90844af7a3f3..9f3ad2355e5a0c945e94f946c2c989280ff2fbef 100644 (file)
@@ -43,6 +43,8 @@ protected:
   CORE_ADDR low_get_pc (regcache *regcache) override;
 
   void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -118,19 +120,18 @@ cris_target::sw_breakpoint_from_kind (int kind, int *size)
   return (const gdb_byte *) &cris_breakpoint;
 }
 
-static int
-cris_breakpoint_at (CORE_ADDR where)
+bool
+cris_target::low_breakpoint_at (CORE_ADDR where)
 {
   unsigned short insn;
 
-  the_target->read_memory (where, (unsigned char *) &insn,
-                          cris_breakpoint_len);
+  read_memory (where, (unsigned char *) &insn, cris_breakpoint_len);
   if (insn == cris_breakpoint)
-    return 1;
+    return true;
 
   /* If necessary, recognize more trap instructions here.  GDB only uses the
      one.  */
-  return 0;
+  return false;
 }
 
 void
@@ -158,7 +159,6 @@ cris_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  cris_breakpoint_at,
 };
 
 /* The linux target ops object.  */
index b55a0176dde72d7414699dcb4186577ac9ac6dca..8d84a8d8a1f3568ca4defec940e3e6f02ddd0be7 100644 (file)
@@ -43,6 +43,8 @@ protected:
   CORE_ADDR low_get_pc (regcache *regcache) override;
 
   void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -128,19 +130,18 @@ crisv32_target::sw_breakpoint_from_kind (int kind, int *size)
   return (const gdb_byte *) &cris_breakpoint;
 }
 
-static int
-cris_breakpoint_at (CORE_ADDR where)
+bool
+crisv32_target::low_breakpoint_at (CORE_ADDR where)
 {
   unsigned short insn;
 
-  the_target->read_memory (where, (unsigned char *) &insn,
-                          cris_breakpoint_len);
+  read_memory (where, (unsigned char *) &insn, cris_breakpoint_len);
   if (insn == cris_breakpoint)
-    return 1;
+    return true;
 
   /* If necessary, recognize more trap instructions here.  GDB only uses the
      one.  */
-  return 0;
+  return false;
 }
 
 static void
@@ -455,7 +456,6 @@ crisv32_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  cris_breakpoint_at,
   cris_supports_z_point_type,
   cris_insert_point,
   cris_remove_point,
index 493c7e4f93d6fd20da2016bfa0fb84f1ae4b14b4..64b39be4b0007580e4e2cdf54d5ee6c403823100 100644 (file)
@@ -42,6 +42,8 @@ protected:
   bool low_cannot_store_register (int regno) override;
 
   bool low_fetch_register (regcache *regcache, int regno) override;
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -55,6 +57,13 @@ ia64_target::sw_breakpoint_from_kind (int kind, int *size)
                         "implemented by this target");
 }
 
+bool
+ia64_target::low_breakpoint_at (CORE_ADDR pc)
+{
+  gdb_assert_no_reached ("linux target op low_breakpoint_at 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 fd225789347e46e46bb6b7f1788f971518ffbb49..b3f87947ff682ccef100cb62b315e372d31dec61 100644 (file)
@@ -856,7 +856,7 @@ linux_process_target::save_stop_reason (lwp_info *lwp)
      then the user inserts a breakpoint inside the range.  In that
      case we need to report the breakpoint PC.  */
   if ((!lwp->stepping || lwp->stop_pc == sw_breakpoint_pc)
-      && (*the_low_target.breakpoint_at) (sw_breakpoint_pc))
+      && low_breakpoint_at (sw_breakpoint_pc))
     lwp->stop_reason = TARGET_STOPPED_BY_SW_BREAKPOINT;
 
   if (hardware_breakpoint_inserted_here (pc))
@@ -1710,7 +1710,7 @@ linux_process_target::thread_still_has_status_pending (thread_info *thread)
 
 #if !USE_SIGTRAP_SIGINFO
       else if (lp->stop_reason == TARGET_STOPPED_BY_SW_BREAKPOINT
-              && !(*the_low_target.breakpoint_at) (pc))
+              && !low_breakpoint_at (pc))
        {
          if (debug_threads)
            debug_printf ("previous SW breakpoint of %ld gone\n",
@@ -3185,7 +3185,7 @@ linux_process_target::wait_1 (ptid_t ptid, target_waitstatus *ourstatus,
          event_child->stop_pc += increment_pc;
          low_set_pc (regcache, event_child->stop_pc);
 
-         if (!(*the_low_target.breakpoint_at) (event_child->stop_pc))
+         if (!low_breakpoint_at (event_child->stop_pc))
            event_child->stop_reason = TARGET_STOPPED_BY_NO_REASON;
        }
     }
@@ -3200,7 +3200,7 @@ linux_process_target::wait_1 (ptid_t ptid, target_waitstatus *ourstatus,
        && (WSTOPSIG (w) == SIGTRAP
           || ((WSTOPSIG (w) == SIGILL
                || WSTOPSIG (w) == SIGSEGV)
-              && (*the_low_target.breakpoint_at) (event_child->stop_pc))));
+              && low_breakpoint_at (event_child->stop_pc))));
 
   if (maybe_internal_trap)
     {
index 5867960ae599ca5caf4e6cef7fd965f740fa46f5..5dcddc41aaacd7475c966acb4bf084ec60a645ca 100644 (file)
@@ -131,8 +131,6 @@ struct lwp_info;
 
 struct linux_target_ops
 {
-  int (*breakpoint_at) (CORE_ADDR pc);
-
   /* Breakpoint and watchpoint related functions.  See target.h for
      comments.  */
   int (*supports_z_point_type) (char z_type);
@@ -666,6 +664,9 @@ protected:
      'supports_software_single_step' to return true.  */
   virtual std::vector<CORE_ADDR> low_get_next_pcs (regcache *regcache);
 
+  /* Return true if there is a breakpoint at PC.  */
+  virtual bool low_breakpoint_at (CORE_ADDR pc) = 0;
+
   /* How many bytes the PC should be decremented after a break.  */
   virtual int low_decr_pc_after_break ();
 };
index 1d23438687e0264930b8b3a1d4c2bf139d8d2da5..f24f0425b98c083b70e30f62166882507b7759bd 100644 (file)
@@ -46,6 +46,8 @@ protected:
   CORE_ADDR low_get_pc (regcache *regcache) override;
 
   void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -112,19 +114,18 @@ m32r_target::sw_breakpoint_from_kind (int kind, int *size)
   return (const gdb_byte *) &m32r_breakpoint;
 }
 
-static int
-m32r_breakpoint_at (CORE_ADDR where)
+bool
+m32r_target::low_breakpoint_at (CORE_ADDR where)
 {
   unsigned short insn;
 
-  the_target->read_memory (where, (unsigned char *) &insn,
-                          m32r_breakpoint_len);
+  read_memory (where, (unsigned char *) &insn, m32r_breakpoint_len);
   if (insn == m32r_breakpoint)
-    return 1;
+    return true;
 
   /* If necessary, recognize more trap instructions here.  GDB only uses the
      one.  */
-  return 0;
+  return false;
 }
 
 void
@@ -160,7 +161,6 @@ m32r_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  m32r_breakpoint_at,
   NULL, /* supports_z_point_type */
   NULL, /* insert_point */
   NULL, /* remove_point */
index 33e0d7b1b8693e36d22455de3a0d12fd32f64b82..702da9589be05ed35d1e968b978c472aa340baa8 100644 (file)
@@ -44,6 +44,8 @@ protected:
   void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
 
   int low_decr_pc_after_break () override;
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -189,16 +191,16 @@ m68k_target::sw_breakpoint_from_kind (int kind, int *size)
   return m68k_breakpoint;
 }
 
-static int
-m68k_breakpoint_at (CORE_ADDR pc)
+bool
+m68k_target::low_breakpoint_at (CORE_ADDR pc)
 {
   unsigned char c[2];
 
   read_inferior_memory (pc, c, 2);
   if (c[0] == 0x4E && c[1] == 0x4F)
-    return 1;
+    return true;
 
-  return 0;
+  return false;
 }
 
 #include <asm/ptrace.h>
@@ -263,7 +265,6 @@ m68k_supports_hardware_single_step (void)
 }
 
 struct linux_target_ops the_low_target = {
-  m68k_breakpoint_at,
   NULL, /* supports_z_point_type */
   NULL, /* insert_point */
   NULL, /* remove_point */
index 82e141f0250528fddb7ac3e06d13ccb4bb8d96f3..b938473735e8b8279acaa4ce84bafe8df6fc5624 100644 (file)
@@ -50,6 +50,8 @@ protected:
   CORE_ADDR low_get_pc (regcache *regcache) override;
 
   void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -326,18 +328,18 @@ mips_target::sw_breakpoint_from_kind (int kind, int *size)
   return (const gdb_byte *) &mips_breakpoint;
 }
 
-static int
-mips_breakpoint_at (CORE_ADDR where)
+bool
+mips_target::low_breakpoint_at (CORE_ADDR where)
 {
   unsigned int insn;
 
-  the_target->read_memory (where, (unsigned char *) &insn, 4);
+  read_memory (where, (unsigned char *) &insn, 4);
   if (insn == mips_breakpoint)
-    return 1;
+    return true;
 
   /* If necessary, recognize more trap instructions here.  GDB only uses the
      one.  */
-  return 0;
+  return false;
 }
 
 /* Mark the watch registers of lwp, represented by ENTRY, as changed.  */
@@ -966,7 +968,6 @@ mips_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  mips_breakpoint_at,
   mips_supports_z_point_type,
   mips_insert_point,
   mips_remove_point,
index 2544b495e0f78d70cfcafb5638c28389fc7ee6a4..d4f83d144b7e71902eaab8850e993410c5f30882 100644 (file)
@@ -54,6 +54,8 @@ protected:
   CORE_ADDR low_get_pc (regcache *regcache) override;
 
   void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -163,24 +165,24 @@ nios2_target::sw_breakpoint_from_kind (int kind, int *size)
   return (const gdb_byte *) &nios2_breakpoint;
 }
 
-/* Implement the breakpoint_at linux_target_ops method.  */
+/* Implement the low_breakpoint_at linux target ops method.  */
 
-static int
-nios2_breakpoint_at (CORE_ADDR where)
+bool
+nios2_target::low_breakpoint_at (CORE_ADDR where)
 {
   unsigned int insn;
 
   /* For R2, first check for the 2-byte CDX trap.n breakpoint encoding.  */
 #if defined(__nios2_arch__) && __nios2_arch__ == 2
-  the_target->read_memory (where, (unsigned char *) &insn, 2);
+  read_memory (where, (unsigned char *) &insn, 2);
   if (insn == CDX_BREAKPOINT)
-    return 1;
+    return true;
 #endif
 
-  the_target->read_memory (where, (unsigned char *) &insn, 4);
+  read_memory (where, (unsigned char *) &insn, 4);
   if (insn == nios2_breakpoint)
-    return 1;
-  return 0;
+    return true;
+  return false;
 }
 
 /* Fetch the thread-local storage pointer for libthread_db.  */
@@ -277,7 +279,6 @@ nios2_target::get_regs_info ()
 
 struct linux_target_ops the_low_target =
 {
-  nios2_breakpoint_at,
 };
 
 /* The linux target ops object.  */
index e488b7d3feac7787c8a6ac7a7869215a7faeb140..a8f51eb78e0d18c7ae1f4fb0e664d1a642c4606b 100644 (file)
@@ -67,6 +67,8 @@ protected:
   CORE_ADDR low_get_pc (regcache *regcache) override;
 
   void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -307,18 +309,18 @@ ppc_target::sw_breakpoint_from_kind (int kind, int *size)
   return (const gdb_byte *) &ppc_breakpoint;
 }
 
-static int
-ppc_breakpoint_at (CORE_ADDR where)
+bool
+ppc_target::low_breakpoint_at (CORE_ADDR where)
 {
   unsigned int insn;
 
-  the_target->read_memory (where, (unsigned char *) &insn, 4);
+  read_memory (where, (unsigned char *) &insn, 4);
   if (insn == ppc_breakpoint)
-    return 1;
+    return true;
   /* If necessary, recognize more trap instructions here.  GDB only uses
      the one.  */
 
-  return 0;
+  return false;
 }
 
 /* Implement supports_z_point_type target-ops.
@@ -3406,7 +3408,6 @@ ppc_get_ipa_tdesc_idx (void)
 }
 
 struct linux_target_ops the_low_target = {
-  ppc_breakpoint_at,
   ppc_supports_z_point_type,
   ppc_insert_point,
   ppc_remove_point,
index 9f3ea590fa70b147465d5e008b013b1e831b93cd..1831f1a3254b897bb41a28efffc4fb03bb563d4a 100644 (file)
@@ -57,6 +57,8 @@ protected:
   CORE_ADDR low_get_pc (regcache *regcache) override;
 
   void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -283,10 +285,10 @@ riscv_target::sw_breakpoint_from_kind (int kind, int *size)
     }
 }
 
-/* Implementation of linux_target_ops method "breakpoint_at".  */
+/* Implementation of linux target ops method "low_breakpoint_at".  */
 
-static int
-riscv_breakpoint_at (CORE_ADDR pc)
+bool
+riscv_target::low_breakpoint_at (CORE_ADDR pc)
 {
   union
     {
@@ -301,15 +303,14 @@ riscv_breakpoint_at (CORE_ADDR pc)
              && target_read_memory (pc + sizeof (buf.insn), buf.bytes,
                                     sizeof (buf.insn)) == 0
              && buf.insn == riscv_ibreakpoint[1])))
-    return 1;
+    return true;
   else
-    return 0;
+    return false;
 }
 
 /* RISC-V/Linux target operations.  */
 struct linux_target_ops the_low_target =
 {
-  riscv_breakpoint_at,
 };
 
 /* The linux target ops object.  */
index f9444312121165747ddbe140808733157e7b7121..c6e0542b934ba59455b8f7bc8d528fa946d08de3 100644 (file)
@@ -76,6 +76,8 @@ protected:
   void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
 
   int low_decr_pc_after_break () override;
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -670,8 +672,8 @@ s390_target::low_arch_setup ()
 }
 
 
-static int
-s390_breakpoint_at (CORE_ADDR pc)
+bool
+s390_target::low_breakpoint_at (CORE_ADDR pc)
 {
   unsigned char c[s390_breakpoint_len];
   read_inferior_memory (pc, c, s390_breakpoint_len);
@@ -2834,7 +2836,6 @@ s390_emit_ops (void)
 }
 
 struct linux_target_ops the_low_target = {
-  s390_breakpoint_at,
   s390_supports_z_point_type,
   NULL,
   NULL,
index 77a4f105d1a6fed99ca74902099609fe06badfa4..b88dd4695391a05a9d01ec2d8ef3b7b2a4623a40 100644 (file)
@@ -42,6 +42,8 @@ protected:
   CORE_ADDR low_get_pc (regcache *regcache) override;
 
   void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -118,18 +120,18 @@ sh_target::sw_breakpoint_from_kind (int kind, int *size)
   return (const gdb_byte *) &sh_breakpoint;
 }
 
-static int
-sh_breakpoint_at (CORE_ADDR where)
+bool
+sh_target::low_breakpoint_at (CORE_ADDR where)
 {
   unsigned short insn;
 
-  the_target->read_memory (where, (unsigned char *) &insn, 2);
+  read_memory (where, (unsigned char *) &insn, 2);
   if (insn == sh_breakpoint)
-    return 1;
+    return true;
 
   /* If necessary, recognize more trap instructions here.  GDB only uses the
      one.  */
-  return 0;
+  return false;
 }
 
 /* Support for hardware single step.  */
@@ -190,7 +192,6 @@ sh_target::low_arch_setup ()
 }
 
 struct linux_target_ops the_low_target = {
-  sh_breakpoint_at,
   NULL, /* supports_z_point_type */
   NULL, /* insert_point */
   NULL, /* remove_point */
index 81eb36225e973e62ff2ac0562c99e62525efcdf5..c5475d270bf05caf9e5650736b2ea37bfa27114c 100644 (file)
@@ -65,6 +65,8 @@ protected:
   CORE_ADDR low_get_pc (regcache *regcache) override;
 
   /* No low_set_pc is needed.  */
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -278,20 +280,20 @@ sparc_target::sw_breakpoint_from_kind (int kind, int *size)
   return sparc_breakpoint;
 }
 
-static int
-sparc_breakpoint_at (CORE_ADDR where)
+bool
+sparc_target::low_breakpoint_at (CORE_ADDR where)
 {
   unsigned char insn[INSN_SIZE];
 
-  the_target->read_memory (where, (unsigned char *) insn, sizeof (insn));
+  read_memory (where, (unsigned char *) insn, sizeof (insn));
 
   if (memcmp (sparc_breakpoint, insn, sizeof (insn)) == 0)
-    return 1;
+    return true;
 
   /* If necessary, recognize more trap instructions here.  GDB only
      uses TRAP Always.  */
 
-  return 0;
+  return false;
 }
 
 void
@@ -339,7 +341,6 @@ sparc_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  sparc_breakpoint_at,
   NULL,  /* supports_z_point_type */
   NULL, NULL, NULL, NULL,
   NULL, NULL
index 51453c6713c41c9e84aa7ee322a16c0677fe7bf6..dad8a33510be97b3d8f22230c440fe4a9ed5ccf8 100644 (file)
@@ -61,6 +61,8 @@ protected:
   CORE_ADDR low_get_pc (regcache *regcache) override;
 
   void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -271,18 +273,18 @@ tic6x_target::low_set_pc (regcache *regcache, CORE_ADDR pc)
   supply_register_by_name (regcache, "PC", newpc.buf);
 }
 
-static int
-tic6x_breakpoint_at (CORE_ADDR where)
+bool
+tic6x_target::low_breakpoint_at (CORE_ADDR where)
 {
   unsigned int insn;
 
-  the_target->read_memory (where, (unsigned char *) &insn, 4);
+  read_memory (where, (unsigned char *) &insn, 4);
   if (insn == tic6x_breakpoint)
-    return 1;
+    return true;
 
   /* If necessary, recognize more trap instructions here.  GDB only uses the
      one.  */
-  return 0;
+  return false;
 }
 
 /* Fetch the thread-local storage pointer for libthread_db.  */
@@ -421,7 +423,6 @@ tic6x_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  tic6x_breakpoint_at,
   NULL, /* supports_z_point_type */
   NULL, /* insert_point */
   NULL, /* remove_point */
index 53d39c47f45a3abe1e355a0d1af1955599375a2f..49c18b157eb1aa1c082951cc3411a6378829bd25 100644 (file)
@@ -46,6 +46,8 @@ protected:
   CORE_ADDR low_get_pc (regcache *regcache) override;
 
   void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -127,18 +129,18 @@ tile_target::sw_breakpoint_from_kind (int kind, int *size)
   return (const gdb_byte *) &tile_breakpoint;
 }
 
-static int
-tile_breakpoint_at (CORE_ADDR where)
+bool
+tile_target::low_breakpoint_at (CORE_ADDR where)
 {
   uint64_t insn;
 
-  the_target->read_memory (where, (unsigned char *) &insn, 8);
+  read_memory (where, (unsigned char *) &insn, 8);
   if (insn == tile_breakpoint)
-    return 1;
+    return true;
 
   /* If necessary, recognize more trap instructions here.  GDB only uses the
      one.  */
-  return 0;
+  return false;
 }
 
 static void
@@ -222,7 +224,6 @@ tile_supports_hardware_single_step (void)
 
 struct linux_target_ops the_low_target =
 {
-  tile_breakpoint_at,
   NULL, /* supports_z_point_type */
   NULL, /* insert_point */
   NULL, /* remove_point */
index eb36aced8b6e49f009a5faa0026aead3677bff3d..e7e6d5427d3ff52c99ba739b12f674578c456f4d 100644 (file)
@@ -123,6 +123,8 @@ protected:
   void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
 
   int low_decr_pc_after_break () override;
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -560,16 +562,16 @@ x86_target::low_decr_pc_after_break ()
 static const gdb_byte x86_breakpoint[] = { 0xCC };
 #define x86_breakpoint_len 1
 
-static int
-x86_breakpoint_at (CORE_ADDR pc)
+bool
+x86_target::low_breakpoint_at (CORE_ADDR pc)
 {
   unsigned char c;
 
-  the_target->read_memory (pc, &c, 1);
+  read_memory (pc, &c, 1);
   if (c == 0xCC)
-    return 1;
+    return true;
 
-  return 0;
+  return false;
 }
 \f
 /* Low-level function vector.  */
@@ -2908,7 +2910,6 @@ x86_get_ipa_tdesc_idx (void)
 
 struct linux_target_ops the_low_target =
 {
-  x86_breakpoint_at,
   x86_supports_z_point_type,
   x86_insert_point,
   x86_remove_point,
index 606204b45e4f6fc1cc7d6a23ba847581436fe44e..19152262a126b06e02281ed09b68a68192332227 100644 (file)
@@ -43,6 +43,8 @@ protected:
   CORE_ADDR low_get_pc (regcache *regcache) override;
 
   void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -263,13 +265,12 @@ xtensa_target::sw_breakpoint_from_kind (int kind, int *size)
   return xtensa_breakpoint;
 }
 
-static int
-xtensa_breakpoint_at (CORE_ADDR where)
+bool
+xtensa_target::low_breakpoint_at (CORE_ADDR where)
 {
     unsigned long insn;
 
-    the_target->read_memory (where, (unsigned char *) &insn,
-                            xtensa_breakpoint_len);
+    read_memory (where, (unsigned char *) &insn, xtensa_breakpoint_len);
     return memcmp((char *) &insn,
                  xtensa_breakpoint, xtensa_breakpoint_len) == 0;
 }
@@ -328,7 +329,6 @@ xtensa_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  xtensa_breakpoint_at,
   NULL, /* supports_z_point_type */
   NULL, /* insert_point */
   NULL, /* remove_point */
This page took 0.064149 seconds and 4 git commands to generate.