Add target_ops argument to to_region_ok_for_hw_watchpoint
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 04:29:45 +0000 (21:29 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:45:35 +0000 (07:45 -0700)
2014-02-19  Tom Tromey  <tromey@redhat.com>

* target.h (struct target_ops) <to_region_ok_for_hw_watchpoint>:
Add argument.
(target_region_ok_for_hw_watchpoint): Add argument.
* target.c (debug_to_region_ok_for_hw_watchpoint): Add argument.
(default_region_ok_for_hw_watchpoint): Add argument.
* spu-multiarch.c (spu_region_ok_for_hw_watchpoint): Add argument.
* s390-linux-nat.c (s390_region_ok_for_hw_watchpoint): Add 'self'
argument.
* remote.c (remote_region_ok_for_hw_watchpoint): Add 'self'
argument.
* procfs.c (procfs_region_ok_for_hw_watchpoint): Add 'self'
argument.
* ppc-linux-nat.c (ppc_linux_region_ok_for_hw_watchpoint): Add
'self' argument.
* mips-linux-nat.c (mips_linux_region_ok_for_hw_watchpoint): Add
'self' argument.
* inf-ttrace.c (inf_ttrace_region_ok_for_hw_watchpoint): Add
'self' argument.
* i386-nat.c (i386_region_ok_for_watchpoint): Add 'self' argument.
* arm-linux-nat.c (arm_linux_region_ok_for_hw_watchpoint): Add
'self' argument.
* aarch64-linux-nat.c (aarch64_linux_region_ok_for_hw_watchpoint):
Add 'self' argument.

13 files changed:
gdb/ChangeLog
gdb/aarch64-linux-nat.c
gdb/arm-linux-nat.c
gdb/i386-nat.c
gdb/inf-ttrace.c
gdb/mips-linux-nat.c
gdb/ppc-linux-nat.c
gdb/procfs.c
gdb/remote.c
gdb/s390-linux-nat.c
gdb/spu-multiarch.c
gdb/target.c
gdb/target.h

index ac6184b68cbdccb960b14131ec8226172db1dbd9..763aa278b84e7fc3c161d0713a38ec7915a1f755 100644 (file)
@@ -1,3 +1,29 @@
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target.h (struct target_ops) <to_region_ok_for_hw_watchpoint>:
+       Add argument.
+       (target_region_ok_for_hw_watchpoint): Add argument.
+       * target.c (debug_to_region_ok_for_hw_watchpoint): Add argument.
+       (default_region_ok_for_hw_watchpoint): Add argument.
+       * spu-multiarch.c (spu_region_ok_for_hw_watchpoint): Add argument.
+       * s390-linux-nat.c (s390_region_ok_for_hw_watchpoint): Add 'self'
+       argument.
+       * remote.c (remote_region_ok_for_hw_watchpoint): Add 'self'
+       argument.
+       * procfs.c (procfs_region_ok_for_hw_watchpoint): Add 'self'
+       argument.
+       * ppc-linux-nat.c (ppc_linux_region_ok_for_hw_watchpoint): Add
+       'self' argument.
+       * mips-linux-nat.c (mips_linux_region_ok_for_hw_watchpoint): Add
+       'self' argument.
+       * inf-ttrace.c (inf_ttrace_region_ok_for_hw_watchpoint): Add
+       'self' argument.
+       * i386-nat.c (i386_region_ok_for_watchpoint): Add 'self' argument.
+       * arm-linux-nat.c (arm_linux_region_ok_for_hw_watchpoint): Add
+       'self' argument.
+       * aarch64-linux-nat.c (aarch64_linux_region_ok_for_hw_watchpoint):
+       Add 'self' argument.
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target.h (struct target_ops) <to_insert_watchpoint>: Add
index a69e31fd1045fcc4eaba9343e20decc5fc1ac4fb..c6437fe0ded79b10653a2b22afdafd67e0a41576 100644 (file)
@@ -1403,7 +1403,8 @@ aarch64_linux_remove_watchpoint (struct target_ops *self,
 /* Implement the "to_region_ok_for_hw_watchpoint" target_ops method.  */
 
 static int
-aarch64_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
+aarch64_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
+                                          CORE_ADDR addr, int len)
 {
   CORE_ADDR aligned_addr;
 
index c4b34cdf375de97c4b3396c2f66b81ad08faec78..75f58ca49799e2495902a1fcf9140edcb70bcbbc 100644 (file)
@@ -1076,7 +1076,8 @@ arm_linux_remove_hw_breakpoint (struct target_ops *self,
 /* Are we able to use a hardware watchpoint for the LEN bytes starting at 
    ADDR?  */
 static int
-arm_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
+arm_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
+                                      CORE_ADDR addr, int len)
 {
   const struct arm_linux_hwbp_cap *cap = arm_linux_get_hwbp_cap ();
   CORE_ADDR max_wp_length, aligned_addr;
index cd766cf13229f33f615009100748bfc49df6bedd..2f80a6eb7ec0d9bedf9a3aa3fddcb3aa8e07fdb5 100644 (file)
@@ -664,7 +664,8 @@ i386_remove_watchpoint (struct target_ops *self,
    address ADDR and whose length is LEN bytes.  */
 
 static int
-i386_region_ok_for_watchpoint (CORE_ADDR addr, int len)
+i386_region_ok_for_watchpoint (struct target_ops *self,
+                              CORE_ADDR addr, int len)
 {
   struct i386_debug_reg_state *state
     = i386_debug_reg_state (ptid_get_pid (inferior_ptid));
index 919515f7fbcf6ead0d662b5963c97bf54ba688ea..d046bba68bcb8ed37fa16fc280c1df42f5ad630f 100644 (file)
@@ -368,7 +368,8 @@ inf_ttrace_can_use_hw_breakpoint (struct target_ops *self,
 }
 
 static int
-inf_ttrace_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
+inf_ttrace_region_ok_for_hw_watchpoint (struct target_ops *self,
+                                       CORE_ADDR addr, int len)
 {
   return 1;
 }
index d8781fc6543bdeaa0c9872e2a6b0a84fd8c7a946..4c28733a2b8bd53e1f3e0d221761562235ae77b5 100644 (file)
@@ -589,7 +589,8 @@ mips_linux_stopped_data_address (struct target_ops *t, CORE_ADDR *paddr)
    the specified region can be covered by the watch registers.  */
 
 static int
-mips_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
+mips_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
+                                       CORE_ADDR addr, int len)
 {
   struct pt_watch_regs dummy_regs;
   int i;
index f77d225d763edc5339846fa3b38dd0e265cff477..dd0fe8c17cf29b30e15450ea0aec312214f2e781 100644 (file)
@@ -1497,7 +1497,8 @@ ppc_linux_can_use_hw_breakpoint (struct target_ops *self,
 }
 
 static int
-ppc_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
+ppc_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
+                                      CORE_ADDR addr, int len)
 {
   /* Handle sub-8-byte quantities.  */
   if (len <= 0)
index e1de2ac2bc494db5096ee78429ce8d66dfad05ca..511ddf1c812e7b3d7337c28f80e0a3056d1a9488 100644 (file)
@@ -4930,7 +4930,8 @@ procfs_remove_watchpoint (struct target_ops *self,
 }
 
 static int
-procfs_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
+procfs_region_ok_for_hw_watchpoint (struct target_ops *self,
+                                   CORE_ADDR addr, int len)
 {
   /* The man page for proc(4) on Solaris 2.6 and up says that the
      system can support "thousands" of hardware watchpoints, but gives
index d851bf798abbd1af681e783405641543b66cc058..6424304b5b175f29ce2c4b7f87f66d56baade6c4 100644 (file)
@@ -8259,7 +8259,8 @@ int remote_hw_watchpoint_length_limit = -1;
 int remote_hw_breakpoint_limit = -1;
 
 static int
-remote_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
+remote_region_ok_for_hw_watchpoint (struct target_ops *self,
+                                   CORE_ADDR addr, int len)
 {
   if (remote_hw_watchpoint_length_limit == 0)
     return 0;
index 342d6ad86a7c5a1230efc6f3df05b75960cb4c4b..5c3895202ad646ec7925ac06943f8e33cadf373a 100644 (file)
@@ -566,7 +566,8 @@ s390_can_use_hw_breakpoint (struct target_ops *self,
 }
 
 static int
-s390_region_ok_for_hw_watchpoint (CORE_ADDR addr, int cnt)
+s390_region_ok_for_hw_watchpoint (struct target_ops *self,
+                                 CORE_ADDR addr, int cnt)
 {
   return 1;
 }
index c3263bad9cb5f8928099b1fe7f88bfa7965eb0fd..bd6c836615af55879c90fede542d551e225fb468 100644 (file)
@@ -118,7 +118,8 @@ spu_thread_architecture (struct target_ops *ops, ptid_t ptid)
 
 /* Override the to_region_ok_for_hw_watchpoint routine.  */
 static int
-spu_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
+spu_region_ok_for_hw_watchpoint (struct target_ops *self,
+                                CORE_ADDR addr, int len)
 {
   struct target_ops *ops_beneath = find_target_beneath (&spu_ops);
   while (ops_beneath && !ops_beneath->to_region_ok_for_hw_watchpoint)
@@ -129,7 +130,8 @@ spu_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
     return 0;
 
   if (ops_beneath)
-    return ops_beneath->to_region_ok_for_hw_watchpoint (addr, len);
+    return ops_beneath->to_region_ok_for_hw_watchpoint (ops_beneath,
+                                                       addr, len);
 
   return 0;
 }
index d73792843c40c4abd7950e62c41feed9e241397d..9cc5a46302be5fc9332ec6cf2fe046da68ef9420 100644 (file)
@@ -52,7 +52,8 @@ static void default_terminal_info (const char *, int);
 static int default_watchpoint_addr_within_range (struct target_ops *,
                                                 CORE_ADDR, CORE_ADDR, int);
 
-static int default_region_ok_for_hw_watchpoint (CORE_ADDR, int);
+static int default_region_ok_for_hw_watchpoint (struct target_ops *,
+                                               CORE_ADDR, int);
 
 static void tcomplain (void) ATTRIBUTE_NORETURN;
 
@@ -124,7 +125,8 @@ static int debug_to_stopped_data_address (struct target_ops *, CORE_ADDR *);
 static int debug_to_watchpoint_addr_within_range (struct target_ops *,
                                                  CORE_ADDR, CORE_ADDR, int);
 
-static int debug_to_region_ok_for_hw_watchpoint (CORE_ADDR, int);
+static int debug_to_region_ok_for_hw_watchpoint (struct target_ops *self,
+                                                CORE_ADDR, int);
 
 static int debug_to_can_accel_watchpoint_condition (CORE_ADDR, int, int,
                                                    struct expression *);
@@ -3641,7 +3643,8 @@ target_fileio_read_stralloc (const char *filename)
 
 
 static int
-default_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
+default_region_ok_for_hw_watchpoint (struct target_ops *self,
+                                    CORE_ADDR addr, int len)
 {
   return (len <= gdbarch_ptr_bit (target_gdbarch ()) / TARGET_CHAR_BIT);
 }
@@ -4647,11 +4650,13 @@ debug_to_can_use_hw_breakpoint (struct target_ops *self,
 }
 
 static int
-debug_to_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
+debug_to_region_ok_for_hw_watchpoint (struct target_ops *self,
+                                     CORE_ADDR addr, int len)
 {
   CORE_ADDR retval;
 
-  retval = debug_target.to_region_ok_for_hw_watchpoint (addr, len);
+  retval = debug_target.to_region_ok_for_hw_watchpoint (&debug_target,
+                                                       addr, len);
 
   fprintf_unfiltered (gdb_stdlog,
                      "target_region_ok_for_hw_watchpoint (%s, %ld) = %s\n",
index 69b8b7749d2af4c9920fd2debb7ce03a7652d0c8..e91af7d65a5015acc75c261ed559109a581804bb 100644 (file)
@@ -479,7 +479,8 @@ struct target_ops
 
     /* Documentation of this routine is provided with the corresponding
        target_* macro.  */
-    int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR, int);
+    int (*to_region_ok_for_hw_watchpoint) (struct target_ops *,
+                                          CORE_ADDR, int);
 
     int (*to_can_accel_watchpoint_condition) (CORE_ADDR, int, int,
                                              struct expression *);
@@ -1606,7 +1607,8 @@ extern char *target_thread_name (struct thread_info *);
    memory region, or zero if not supported.  */
 
 #define target_region_ok_for_hw_watchpoint(addr, len) \
-    (*current_target.to_region_ok_for_hw_watchpoint) (addr, len)
+    (*current_target.to_region_ok_for_hw_watchpoint) (&current_target, \
+                                                     addr, len)
 
 
 /* Set/clear a hardware watchpoint starting at ADDR, for LEN bytes.