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

Turn the 'stopped_by_watchpoint' and 'stopped_data_address' linux
target ops into methods of linux_process_target.

* linux-low.h (struct linux_target_ops): Remove the ops.
(class linux_process_target) <check_stopped_by_watchpoint>
<low_stopped_by_watchpoint>
<low_stopped_data_address>: Declare.
* linux-low.cc (check_stopped_by_watchpoint): Turn into...
(linux_process_target::check_stopped_by_watchpoint): ...this.
(linux_process_target::low_stopped_by_watchpoint): Define.
(linux_process_target::low_stopped_data_address): Define.
* linux-x86-low.cc (class x86_target) <low_stopped_by_watchpoint>
<low_stopped_data_address>: Declare.
(x86_stopped_by_watchpoint): Turn into...
(x86_target::low_stopped_by_watchpoint): ...this.
(x86_stopped_data_address): Turn into...
(x86_target::low_stopped_data_address): ...this.
(the_low_target): Remove the op fields.
* linux-aarch64-low.cc (class aarch64_target)
<low_stopped_by_watchpoint>
<low_stopped_data_address>: Declare.
(aarch64_stopped_by_watchpoint): Turn into...
(aarch64_target::low_stopped_by_watchpoint): ...this.
(aarch64_stopped_data_address): Turn into...
(aarch64_target::low_stopped_data_address): ...this.
(the_low_target): Remove the op fields.
* linux-arm-low.cc (class arm_target) <low_stopped_by_watchpoint>
<low_stopped_data_address>: Declare.
(arm_stopped_by_watchpoint): Turn into...
(arm_target::low_stopped_by_watchpoint): ...this.
(arm_stopped_data_address): Turn into...
(arm_target::low_stopped_data_address): ...this.
(the_low_target): Remove the op fields.
* linux-crisv32-low.cc (class crisv32_target)
<low_stopped_by_watchpoint>
<low_stopped_data_address>: Declare.
(cris_stopped_by_watchpoint): Turn into...
(crisv32_target::low_stopped_by_watchpoint): ...this.
(cris_stopped_data_address): Turn into...
(crisv32_target::low_stopped_data_address): ...this.
(the_low_target): Remove the op fields.
* linux-mips-low.cc (class mips_target) <low_stopped_by_watchpoint>
<low_stopped_data_address>: Declare.
(mips_stopped_by_watchpoint): Turn into...
(mips_target::low_stopped_by_watchpoint): ...this.
(mips_stopped_data_address): Turn into...
(mips_target::low_stopped_data_address): ...this.
(the_low_target): Remove the op fields.
* linux-bfin-low.cc (the_low_target): Remove the op fields.
* 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-sparc-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.

18 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-mips-low.cc
gdbserver/linux-ppc-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 45860154721dfdd14cc67d18654d5d13b2be0cff..0b17ea5be2609bb6b736ed39afde12a081527b66 100644 (file)
@@ -1,3 +1,64 @@
+2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
+
+       Turn the 'stopped_by_watchpoint' and 'stopped_data_address' linux
+       target ops into methods of linux_process_target.
+
+       * linux-low.h (struct linux_target_ops): Remove the ops.
+       (class linux_process_target) <check_stopped_by_watchpoint>
+       <low_stopped_by_watchpoint>
+       <low_stopped_data_address>: Declare.
+       * linux-low.cc (check_stopped_by_watchpoint): Turn into...
+       (linux_process_target::check_stopped_by_watchpoint): ...this.
+       (linux_process_target::low_stopped_by_watchpoint): Define.
+       (linux_process_target::low_stopped_data_address): Define.
+       * linux-x86-low.cc (class x86_target) <low_stopped_by_watchpoint>
+       <low_stopped_data_address>: Declare.
+       (x86_stopped_by_watchpoint): Turn into...
+       (x86_target::low_stopped_by_watchpoint): ...this.
+       (x86_stopped_data_address): Turn into...
+       (x86_target::low_stopped_data_address): ...this.
+       (the_low_target): Remove the op fields.
+       * linux-aarch64-low.cc (class aarch64_target)
+       <low_stopped_by_watchpoint>
+       <low_stopped_data_address>: Declare.
+       (aarch64_stopped_by_watchpoint): Turn into...
+       (aarch64_target::low_stopped_by_watchpoint): ...this.
+       (aarch64_stopped_data_address): Turn into...
+       (aarch64_target::low_stopped_data_address): ...this.
+       (the_low_target): Remove the op fields.
+       * linux-arm-low.cc (class arm_target) <low_stopped_by_watchpoint>
+       <low_stopped_data_address>: Declare.
+       (arm_stopped_by_watchpoint): Turn into...
+       (arm_target::low_stopped_by_watchpoint): ...this.
+       (arm_stopped_data_address): Turn into...
+       (arm_target::low_stopped_data_address): ...this.
+       (the_low_target): Remove the op fields.
+       * linux-crisv32-low.cc (class crisv32_target)
+       <low_stopped_by_watchpoint>
+       <low_stopped_data_address>: Declare.
+       (cris_stopped_by_watchpoint): Turn into...
+       (crisv32_target::low_stopped_by_watchpoint): ...this.
+       (cris_stopped_data_address): Turn into...
+       (crisv32_target::low_stopped_data_address): ...this.
+       (the_low_target): Remove the op fields.
+       * linux-mips-low.cc (class mips_target) <low_stopped_by_watchpoint>
+       <low_stopped_data_address>: Declare.
+       (mips_stopped_by_watchpoint): Turn into...
+       (mips_target::low_stopped_by_watchpoint): ...this.
+       (mips_stopped_data_address): Turn into...
+       (mips_target::low_stopped_data_address): ...this.
+       (the_low_target): Remove the op fields.
+       * linux-bfin-low.cc (the_low_target): Remove the op fields.
+       * 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-sparc-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 'insert_point' and 'remove_point' linux target ops into
index 5660ec0fd6031000b7998d71032ee61382d111c8..96f8f46d4ee000b08925bfa6bf5c92c38284e333 100644 (file)
@@ -86,6 +86,10 @@ protected:
 
   int low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
                        int size, raw_breakpoint *bp) override;
+
+  bool low_stopped_by_watchpoint () override;
+
+  CORE_ADDR low_stopped_data_address () override;
 };
 
 /* The singleton target ops object.  */
@@ -409,10 +413,10 @@ aarch64_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
   return ret;
 }
 
-/* Implementation of linux_target_ops method "stopped_data_address".  */
+/* Implementation of linux target ops method "low_stopped_data_address".  */
 
-static CORE_ADDR
-aarch64_stopped_data_address (void)
+CORE_ADDR
+aarch64_target::low_stopped_data_address ()
 {
   siginfo_t siginfo;
   int pid, i;
@@ -471,15 +475,12 @@ aarch64_stopped_data_address (void)
   return (CORE_ADDR) 0;
 }
 
-/* Implementation of linux_target_ops method "stopped_by_watchpoint".  */
+/* Implementation of linux target ops method "low_stopped_by_watchpoint".  */
 
-static int
-aarch64_stopped_by_watchpoint (void)
+bool
+aarch64_target::low_stopped_by_watchpoint ()
 {
-  if (aarch64_stopped_data_address () != 0)
-    return 1;
-  else
-    return 0;
+  return (low_stopped_data_address () != 0);
 }
 
 /* Fetch the thread-local storage pointer for libthread_db.  */
@@ -3112,8 +3113,6 @@ aarch64_supports_hardware_single_step (void)
 
 struct linux_target_ops the_low_target =
 {
-  aarch64_stopped_by_watchpoint,
-  aarch64_stopped_data_address,
   NULL, /* collect_ptrace_register */
   NULL, /* supply_ptrace_register */
   aarch64_linux_siginfo_fixup,
index edb8cd05c1d1b8b2d8c3e0cbc63fdd1c3bce7a24..2593dfa0eeef26d205251b0fc76d2d5f390260c5 100644 (file)
@@ -95,6 +95,10 @@ protected:
 
   int low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
                        int size, raw_breakpoint *bp) override;
+
+  bool low_stopped_by_watchpoint () override;
+
+  CORE_ADDR low_stopped_data_address () override;
 };
 
 /* The singleton target ops object.  */
@@ -672,43 +676,43 @@ arm_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
 }
 
 /* Return whether current thread is stopped due to a watchpoint.  */
-static int
-arm_stopped_by_watchpoint (void)
+bool
+arm_target::low_stopped_by_watchpoint ()
 {
   struct lwp_info *lwp = get_thread_lwp (current_thread);
   siginfo_t siginfo;
 
   /* We must be able to set hardware watchpoints.  */
   if (arm_linux_get_hw_watchpoint_count () == 0)
-    return 0;
+    return false;
 
   /* Retrieve siginfo.  */
   errno = 0;
   ptrace (PTRACE_GETSIGINFO, lwpid_of (current_thread), 0, &siginfo);
   if (errno != 0)
-    return 0;
+    return false;
 
   /* This must be a hardware breakpoint.  */
   if (siginfo.si_signo != SIGTRAP
       || (siginfo.si_code & 0xffff) != 0x0004 /* TRAP_HWBKPT */)
-    return 0;
+    return false;
 
   /* If we are in a positive slot then we're looking at a breakpoint and not
      a watchpoint.  */
   if (siginfo.si_errno >= 0)
-    return 0;
+    return false;
 
   /* Cache stopped data address for use by arm_stopped_data_address.  */
   lwp->arch_private->stopped_data_address
     = (CORE_ADDR) (uintptr_t) siginfo.si_addr;
 
-  return 1;
+  return true;
 }
 
 /* Return data address that triggered watchpoint.  Called only if
-   arm_stopped_by_watchpoint returned true.  */
-static CORE_ADDR
-arm_stopped_data_address (void)
+   low_stopped_by_watchpoint returned true.  */
+CORE_ADDR
+arm_target::low_stopped_data_address ()
 {
   struct lwp_info *lwp = get_thread_lwp (current_thread);
   return lwp->arch_private->stopped_data_address;
@@ -1101,8 +1105,6 @@ arm_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  arm_stopped_by_watchpoint,
-  arm_stopped_data_address,
   NULL, /* collect_ptrace_register */
   NULL, /* supply_ptrace_register */
   NULL, /* siginfo_fixup */
index 50c1743a6b4b1620b756a116841d510b2357ab8f..bc3e312c18f64943af7ba3ea95c1f47313f08f32 100644 (file)
@@ -171,8 +171,6 @@ bfin_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* stopped_by_watchpoint */
-  NULL, /* stopped_data_address */
   NULL, /* collect_ptrace_register */
   NULL, /* supply_ptrace_register */
   NULL, /* siginfo_fixup */
index 4d5edc570e55fed02925c6eabc51323a2cad08c9..fd458350d5a5196a1492f5e3efc4ccf138a058e4 100644 (file)
@@ -53,6 +53,10 @@ protected:
 
   int low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
                        int size, raw_breakpoint *bp) override;
+
+  bool low_stopped_by_watchpoint () override;
+
+  CORE_ADDR low_stopped_data_address () override;
 };
 
 /* The singleton target ops object.  */
@@ -355,8 +359,8 @@ crisv32_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
   return 0;
 }
 
-static int
-cris_stopped_by_watchpoint (void)
+bool
+crisv32_target::low_stopped_by_watchpoint ()
 {
   unsigned long exs;
   struct regcache *regcache = get_thread_regcache (current_thread, 1);
@@ -366,8 +370,8 @@ cris_stopped_by_watchpoint (void)
   return (((exs & 0xff00) >> 8) == 0xc);
 }
 
-static CORE_ADDR
-cris_stopped_data_address (void)
+CORE_ADDR
+crisv32_target::low_stopped_data_address ()
 {
   unsigned long eda;
   struct regcache *regcache = get_thread_regcache (current_thread, 1);
@@ -464,8 +468,6 @@ crisv32_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  cris_stopped_by_watchpoint,
-  cris_stopped_data_address,
   NULL, /* collect_ptrace_register */
   NULL, /* supply_ptrace_register */
   NULL, /* siginfo_fixup */
index 814c03705cd3f739f300d6629d4fbeee95a859e6..998bd1d05953d82b77a3290ac97aa99897fedca7 100644 (file)
@@ -786,8 +786,6 @@ get_syscall_trapinfo (struct lwp_info *lwp, int *sysno)
   current_thread = saved_thread;
 }
 
-static int check_stopped_by_watchpoint (struct lwp_info *child);
-
 bool
 linux_process_target::save_stop_reason (lwp_info *lwp)
 {
@@ -2245,46 +2243,33 @@ dequeue_one_deferred_signal (struct lwp_info *lwp, int *wstat)
   return 0;
 }
 
-/* Fetch the possibly triggered data watchpoint info and store it in
-   CHILD.
-
-   On some archs, like x86, that use debug registers to set
-   watchpoints, it's possible that the way to know which watched
-   address trapped, is to check the register that is used to select
-   which address to watch.  Problem is, between setting the watchpoint
-   and reading back which data address trapped, the user may change
-   the set of watchpoints, and, as a consequence, GDB changes the
-   debug registers in the inferior.  To avoid reading back a stale
-   stopped-data-address when that happens, we cache in LP the fact
-   that a watchpoint trapped, and the corresponding data address, as
-   soon as we see CHILD stop with a SIGTRAP.  If GDB changes the debug
-   registers meanwhile, we have the cached data we can rely on.  */
-
-static int
-check_stopped_by_watchpoint (struct lwp_info *child)
+bool
+linux_process_target::check_stopped_by_watchpoint (lwp_info *child)
 {
-  if (the_low_target.stopped_by_watchpoint != NULL)
-    {
-      struct thread_info *saved_thread;
+  struct thread_info *saved_thread = current_thread;
+  current_thread = get_lwp_thread (child);
 
-      saved_thread = current_thread;
-      current_thread = get_lwp_thread (child);
+  if (low_stopped_by_watchpoint ())
+    {
+      child->stop_reason = TARGET_STOPPED_BY_WATCHPOINT;
+      child->stopped_data_address = low_stopped_data_address ();
+    }
 
-      if (the_low_target.stopped_by_watchpoint ())
-       {
-         child->stop_reason = TARGET_STOPPED_BY_WATCHPOINT;
+  current_thread = saved_thread;
 
-         if (the_low_target.stopped_data_address != NULL)
-           child->stopped_data_address
-             = the_low_target.stopped_data_address ();
-         else
-           child->stopped_data_address = 0;
-       }
+  return child->stop_reason == TARGET_STOPPED_BY_WATCHPOINT;
+}
 
-      current_thread = saved_thread;
-    }
+bool
+linux_process_target::low_stopped_by_watchpoint ()
+{
+  return false;
+}
 
-  return child->stop_reason == TARGET_STOPPED_BY_WATCHPOINT;
+CORE_ADDR
+linux_process_target::low_stopped_data_address ()
+{
+  return 0;
 }
 
 /* Return the ptrace options that we want to try to enable.  */
index 0fdd8ceb9457facc0ec58a549928d9d6c1af26ed..ee2fdb8e865b93e4658e6001cdfeccd226a8b000 100644 (file)
@@ -131,9 +131,6 @@ struct lwp_info;
 
 struct linux_target_ops
 {
-  int (*stopped_by_watchpoint) (void);
-  CORE_ADDR (*stopped_data_address) (void);
-
   /* Hooks to reformat register data for PEEKUSR/POKEUSR (in particular
      for registers smaller than an xfer unit).  */
   void (*collect_ptrace_register) (struct regcache *regcache,
@@ -622,6 +619,22 @@ private:
   /* Install breakpoints for software single stepping.  */
   void install_software_single_step_breakpoints (lwp_info *lwp);
 
+  /* Fetch the possibly triggered data watchpoint info and store it in
+     CHILD.
+
+     On some archs, like x86, that use debug registers to set
+     watchpoints, it's possible that the way to know which watched
+     address trapped, is to check the register that is used to select
+     which address to watch.  Problem is, between setting the watchpoint
+     and reading back which data address trapped, the user may change
+     the set of watchpoints, and, as a consequence, GDB changes the
+     debug registers in the inferior.  To avoid reading back a stale
+     stopped-data-address when that happens, we cache in LP the fact
+     that a watchpoint trapped, and the corresponding data address, as
+     soon as we see CHILD stop with a SIGTRAP.  If GDB changes the debug
+     registers meanwhile, we have the cached data we can rely on.  */
+  bool check_stopped_by_watchpoint (lwp_info *child);
+
 protected:
   /* The architecture-specific "low" methods are listed below.  */
 
@@ -665,6 +678,10 @@ protected:
   virtual int low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
                                int size, raw_breakpoint *bp);
 
+  virtual bool low_stopped_by_watchpoint ();
+
+  virtual CORE_ADDR low_stopped_data_address ();
+
   /* How many bytes the PC should be decremented after a break.  */
   virtual int low_decr_pc_after_break ();
 };
index bbafe8fa5c2d0c7024e16f656618bd5886599262..14bb83797d9912b4e4f6d672d70a20bfb01c1791 100644 (file)
@@ -161,8 +161,6 @@ m32r_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* stopped_by_watchpoint */
-  NULL, /* stopped_data_address */
   NULL, /* collect_ptrace_register */
   NULL, /* supply_ptrace_register */
   NULL, /* siginfo_fixup */
index fd2d601ba082f51aaa22bc4e4eb648f3c13e4748..7cb80bc2af49b80621c1b46025e9c4ba65f2bb47 100644 (file)
@@ -265,8 +265,6 @@ m68k_supports_hardware_single_step (void)
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* stopped_by_watchpoint */
-  NULL, /* stopped_data_address */
   NULL, /* collect_ptrace_register */
   NULL, /* supply_ptrace_register */
   NULL, /* siginfo_fixup */
index 5696af6fae26aa71ec34eebfe9857216fb7aeb2a..3c2231bda303d86407d3ab1ac64c8e72f210b5b9 100644 (file)
@@ -60,6 +60,10 @@ protected:
 
   int low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
                        int size, raw_breakpoint *bp) override;
+
+  bool low_stopped_by_watchpoint () override;
+
+  CORE_ADDR low_stopped_data_address () override;
 };
 
 /* The singleton target ops object.  */
@@ -608,12 +612,12 @@ mips_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
   return 0;
 }
 
-/* This is the implementation of linux_target_ops method
-   stopped_by_watchpoint.  The watchhi R and W bits indicate
+/* This is the implementation of linux target ops method
+   low_stopped_by_watchpoint.  The watchhi R and W bits indicate
    the watch register triggered. */
 
-static int
-mips_stopped_by_watchpoint (void)
+bool
+mips_target::low_stopped_by_watchpoint ()
 {
   struct process_info *proc = current_process ();
   struct arch_process_info *priv = proc->priv->arch_private;
@@ -632,16 +636,16 @@ mips_stopped_by_watchpoint (void)
   for (n = 0; n < MAX_DEBUG_REGISTER && n < num_valid; n++)
     if (mips_linux_watch_get_watchhi (&priv->watch_readback, n)
        & (R_MASK | W_MASK))
-      return 1;
+      return true;
 
-  return 0;
+  return false;
 }
 
-/* This is the implementation of linux_target_ops method
-   stopped_data_address.  */
+/* This is the implementation of linux target ops method
+   low_stopped_data_address.  */
 
-static CORE_ADDR
-mips_stopped_data_address (void)
+CORE_ADDR
+mips_target::low_stopped_data_address ()
 {
   struct process_info *proc = current_process ();
   struct arch_process_info *priv = proc->priv->arch_private;
@@ -976,8 +980,6 @@ mips_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  mips_stopped_by_watchpoint,
-  mips_stopped_data_address,
   mips_collect_ptrace_register,
   mips_supply_ptrace_register,
   NULL, /* siginfo_fixup */
index d28551534bfa5e992b888975eabd9d38910382a6..deb2ef64f1270e906b4dcbe68e323d140fc5b680 100644 (file)
@@ -3416,8 +3416,6 @@ ppc_get_ipa_tdesc_idx (void)
 }
 
 struct linux_target_ops the_low_target = {
-  NULL,
-  NULL,
   ppc_collect_ptrace_register,
   ppc_supply_ptrace_register,
   NULL, /* siginfo_fixup */
index 36471fbea62e77b7aab0e4e4051716478a585cb0..9e7db23e5d0325f1a33c5feb5f8bb189ad0f7355 100644 (file)
@@ -2838,8 +2838,6 @@ s390_emit_ops (void)
 }
 
 struct linux_target_ops the_low_target = {
-  NULL,
-  NULL,
   s390_collect_ptrace_register,
   s390_supply_ptrace_register,
   NULL, /* siginfo_fixup */
index c4af7defadbbf6f301e05b7dac8cf0ee12fa24cd..a2215ddb4bc92e3ddec5d64a06e8f8d720a9402f 100644 (file)
@@ -192,8 +192,6 @@ sh_target::low_arch_setup ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* stopped_by_watchpoint */
-  NULL, /* stopped_data_address */
   NULL, /* collect_ptrace_register */
   NULL, /* supply_ptrace_register */
   NULL, /* siginfo_fixup */
index 0380cedb800306767ae1cba3faa7e81a2fefef7f..8d1b61b0631ef79cccb3a969ac60f498133f731f 100644 (file)
@@ -341,7 +341,6 @@ sparc_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, NULL,
   NULL, NULL
 };
 
index e6f2203d492c92b74e9cd190721920c510b7b0be..9ff23969c6c4433b4f4cd457643aeebd77731da3 100644 (file)
@@ -423,8 +423,6 @@ tic6x_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* stopped_by_watchpoint */
-  NULL, /* stopped_data_address */
   NULL, /* collect_ptrace_register */
   NULL, /* supply_ptrace_register */
   NULL, /* siginfo_fixup */
index f9c5460989e028ba8ab4f6eb1a0c2d4a3bf3ee12..6efd7b2c8c37f8235ed8a1bcf3ec8de5699fc3e5 100644 (file)
@@ -224,8 +224,6 @@ tile_supports_hardware_single_step (void)
 
 struct linux_target_ops the_low_target =
 {
-  NULL, /* stopped_by_watchpoint */
-  NULL, /* stopped_data_address */
   NULL, /* collect_ptrace_register */
   NULL, /* supply_ptrace_register */
   NULL, /* siginfo_fixup */
index e6566a1da9475da9f952f02a757385b4f584f6f9..1c6e9b1d100273e4cfbe45e50570fee424917f3e 100644 (file)
@@ -133,6 +133,10 @@ protected:
 
   int low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
                        int size, raw_breakpoint *bp) override;
+
+  bool low_stopped_by_watchpoint () override;
+
+  CORE_ADDR low_stopped_data_address () override;
 };
 
 /* The singleton target ops object.  */
@@ -661,15 +665,15 @@ x86_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
     }
 }
 
-static int
-x86_stopped_by_watchpoint (void)
+bool
+x86_target::low_stopped_by_watchpoint ()
 {
   struct process_info *proc = current_process ();
   return x86_dr_stopped_by_watchpoint (&proc->priv->arch_private->debug_reg_state);
 }
 
-static CORE_ADDR
-x86_stopped_data_address (void)
+CORE_ADDR
+x86_target::low_stopped_data_address ()
 {
   struct process_info *proc = current_process ();
   CORE_ADDR addr;
@@ -2918,8 +2922,6 @@ x86_get_ipa_tdesc_idx (void)
 
 struct linux_target_ops the_low_target =
 {
-  x86_stopped_by_watchpoint,
-  x86_stopped_data_address,
   /* collect_ptrace_register/supply_ptrace_register are not needed in the
      native i386 case (no registers smaller than an xfer unit), and are not
      used in the biarch case (HAVE_LINUX_USRREGS is not defined).  */
index a7023f465b298642bd5c268811059af2924d2395..7bc09e99629ab40f9abf2ede7fa9219f62a2664e 100644 (file)
@@ -329,8 +329,6 @@ xtensa_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* stopped_by_watchpoint */
-  NULL, /* stopped_data_address */
   NULL, /* collect_ptrace_register */
   NULL, /* supply_ptrace_register */
   NULL, /* siginfo_fixup */