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

* target.h (struct target_ops) <to_can_use_hw_breakpoint>: Add
argument.
(target_can_use_hardware_watchpoint): Add argument.
* target.c (debug_to_can_use_hw_breakpoint): Add argument.
(update_current_target): Update.
* spu-linux-nat.c (spu_can_use_hw_breakpoint): Add 'self'
argument.
* s390-linux-nat.c (s390_can_use_hw_breakpoint): Add 'self'
argument.
* remote.c (remote_check_watch_resources): Add 'self' argument.
* remote-mips.c (mips_can_use_watchpoint): Add 'self' argument.
* remote-m32r-sdi.c (m32r_can_use_hw_watchpoint): Add 'self'
argument.
* procfs.c (procfs_can_use_hw_breakpoint): Add 'self' argument.
* ppc-linux-nat.c (ppc_linux_can_use_hw_breakpoint): Add 'self'
argument.
* nto-procfs.c (procfs_can_use_hw_breakpoint): Add 'self'
argument.
* mips-linux-nat.c (mips_linux_can_use_hw_breakpoint): Add 'self'
argument.
* inf-ttrace.c (inf_ttrace_can_use_hw_breakpoint): Add 'self'
argument.
* ia64-linux-nat.c (ia64_linux_can_use_hw_breakpoint): Add 'self'
argument.
* ia64-hpux-nat.c (ia64_hpux_can_use_hw_breakpoint): Add 'self'
argument.
* i386-nat.c (i386_can_use_hw_breakpoint): Add 'self' argument.
* arm-linux-nat.c (arm_linux_can_use_hw_breakpoint): Add 'self'
argument.
* aarch64-linux-nat.c (aarch64_linux_can_use_hw_breakpoint): Add
'self' argument.

18 files changed:
gdb/ChangeLog
gdb/aarch64-linux-nat.c
gdb/arm-linux-nat.c
gdb/i386-nat.c
gdb/ia64-hpux-nat.c
gdb/ia64-linux-nat.c
gdb/inf-ttrace.c
gdb/mips-linux-nat.c
gdb/nto-procfs.c
gdb/ppc-linux-nat.c
gdb/procfs.c
gdb/remote-m32r-sdi.c
gdb/remote-mips.c
gdb/remote.c
gdb/s390-linux-nat.c
gdb/spu-linux-nat.c
gdb/target.c
gdb/target.h

index 96d6e5801831245468de66fb48c8baf2ae5af94c..e145c33c72123a157c4d5548aa4e13b627b6afdb 100644 (file)
@@ -1,3 +1,37 @@
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target.h (struct target_ops) <to_can_use_hw_breakpoint>: Add
+       argument.
+       (target_can_use_hardware_watchpoint): Add argument.
+       * target.c (debug_to_can_use_hw_breakpoint): Add argument.
+       (update_current_target): Update.
+       * spu-linux-nat.c (spu_can_use_hw_breakpoint): Add 'self'
+       argument.
+       * s390-linux-nat.c (s390_can_use_hw_breakpoint): Add 'self'
+       argument.
+       * remote.c (remote_check_watch_resources): Add 'self' argument.
+       * remote-mips.c (mips_can_use_watchpoint): Add 'self' argument.
+       * remote-m32r-sdi.c (m32r_can_use_hw_watchpoint): Add 'self'
+       argument.
+       * procfs.c (procfs_can_use_hw_breakpoint): Add 'self' argument.
+       * ppc-linux-nat.c (ppc_linux_can_use_hw_breakpoint): Add 'self'
+       argument.
+       * nto-procfs.c (procfs_can_use_hw_breakpoint): Add 'self'
+       argument.
+       * mips-linux-nat.c (mips_linux_can_use_hw_breakpoint): Add 'self'
+       argument.
+       * inf-ttrace.c (inf_ttrace_can_use_hw_breakpoint): Add 'self'
+       argument.
+       * ia64-linux-nat.c (ia64_linux_can_use_hw_breakpoint): Add 'self'
+       argument.
+       * ia64-hpux-nat.c (ia64_hpux_can_use_hw_breakpoint): Add 'self'
+       argument.
+       * i386-nat.c (i386_can_use_hw_breakpoint): Add 'self' argument.
+       * arm-linux-nat.c (arm_linux_can_use_hw_breakpoint): Add 'self'
+       argument.
+       * aarch64-linux-nat.c (aarch64_linux_can_use_hw_breakpoint): Add
+       'self' argument.
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target.h (struct target_ops) <to_post_attach>: Add argument.
index 703c4ed96e92a9dc58e5226cae4a010c55f70c72..c9a3b4de09d77eab225fb325309026564b576478 100644 (file)
@@ -941,7 +941,8 @@ aarch64_align_watchpoint (CORE_ADDR addr, int len, CORE_ADDR *aligned_addr_p,
    sharing implemented via reference counts.  */
 
 static int
-aarch64_linux_can_use_hw_breakpoint (int type, int cnt, int othertype)
+aarch64_linux_can_use_hw_breakpoint (struct target_ops *self,
+                                    int type, int cnt, int othertype)
 {
   return 1;
 }
index 9fa5f5b16635bb439e191074c98a26082f6b1935..a1a9cc58fe4b72e9d0fe68ceb1a57489a38b6cd7 100644 (file)
@@ -747,7 +747,8 @@ arm_linux_get_hw_watchpoint_count (void)
 /* Have we got a free break-/watch-point available for use?  Returns -1 if
    there is not an appropriate resource available, otherwise returns 1.  */
 static int
-arm_linux_can_use_hw_breakpoint (int type, int cnt, int ot)
+arm_linux_can_use_hw_breakpoint (struct target_ops *self,
+                                int type, int cnt, int ot)
 {
   if (type == bp_hardware_watchpoint || type == bp_read_watchpoint
       || type == bp_access_watchpoint || type == bp_watchpoint)
index 23edc38a4044184cf64fd3e8b27caeebbadcbb5c..bae701a6627f9d904f9a7d3c060e074ebc9a6f5f 100644 (file)
@@ -831,7 +831,8 @@ i386_remove_hw_breakpoint (struct gdbarch *gdbarch,
    sharing implemented via reference counts in i386-nat.c.  */
 
 static int
-i386_can_use_hw_breakpoint (int type, int cnt, int othertype)
+i386_can_use_hw_breakpoint (struct target_ops *self,
+                           int type, int cnt, int othertype)
 {
   return 1;
 }
index 9e6516ddaf6420d4524a4774553c5e67b57369a0..6a4e088c5f0c784507f5eb1a6f5d705b818d4676 100644 (file)
@@ -702,7 +702,8 @@ ia64_hpux_xfer_partial (struct target_ops *ops, enum target_object object,
 /* The "to_can_use_hw_breakpoint" target_ops routine for ia64-hpux.  */
 
 static int
-ia64_hpux_can_use_hw_breakpoint (int type, int cnt, int othertype)
+ia64_hpux_can_use_hw_breakpoint (struct target_ops *self,
+                                int type, int cnt, int othertype)
 {
   /* No hardware watchpoint/breakpoint support yet.  */
   return 0;
index ea575c8bba4d59cb3d75072d3eaf9c3bf2e98cf6..938807f88e81f1ae4b885d829f2fb2712985d19d 100644 (file)
@@ -676,7 +676,8 @@ ia64_linux_stopped_by_watchpoint (struct target_ops *ops)
 }
 
 static int
-ia64_linux_can_use_hw_breakpoint (int type, int cnt, int othertype)
+ia64_linux_can_use_hw_breakpoint (struct target_ops *self,
+                                 int type, int cnt, int othertype)
 {
   return 1;
 }
index e219fb8bdbc8f580916633828833dfe377cfe276..28b55eb269e3fabece9e8e62b1de22e15297be08 100644 (file)
@@ -359,7 +359,8 @@ inf_ttrace_remove_watchpoint (CORE_ADDR addr, int len, int type,
 }
 
 static int
-inf_ttrace_can_use_hw_breakpoint (int type, int len, int ot)
+inf_ttrace_can_use_hw_breakpoint (struct target_ops *self,
+                                 int type, int len, int ot)
 {
   return (type == bp_hardware_watchpoint);
 }
index 98f8d96d669a51f286a15ce6819d1a95b35a53e4..a92078d2a58d5bf71c18e0df8c60f44a40a7e117 100644 (file)
@@ -512,7 +512,8 @@ mips_show_dr (const char *func, CORE_ADDR addr,
    handle the specified watch type.  */
 
 static int
-mips_linux_can_use_hw_breakpoint (int type, int cnt, int ot)
+mips_linux_can_use_hw_breakpoint (struct target_ops *self,
+                                 int type, int cnt, int ot)
 {
   int i;
   uint32_t wanted_mask, irw_mask;
index 9fab8618641abb5175acfb299557c87c61f34b28..4914336c49cacc22a38b9f013be1dd68cd9e4426 100644 (file)
@@ -67,7 +67,8 @@ static void init_procfs_ops (void);
 
 static ptid_t do_attach (ptid_t ptid);
 
-static int procfs_can_use_hw_breakpoint (int, int, int);
+static int procfs_can_use_hw_breakpoint (struct target_ops *self,
+                                        int, int, int);
 
 static int procfs_insert_hw_watchpoint (CORE_ADDR addr, int len, int type,
                                        struct expression *cond);
@@ -1488,7 +1489,8 @@ procfs_hw_watchpoint (int addr, int len, int type)
 }
 
 static int
-procfs_can_use_hw_breakpoint (int type, int cnt, int othertype)
+procfs_can_use_hw_breakpoint (struct target_ops *self,
+                             int type, int cnt, int othertype)
 {
   return 1;
 }
index b38b33ef25a78ac33b539ee16d76a49531bab9bc..c29efdaa413894249de475b899226ec92c4f1120 100644 (file)
@@ -1444,7 +1444,8 @@ have_ptrace_hwdebug_interface (void)
 }
 
 static int
-ppc_linux_can_use_hw_breakpoint (int type, int cnt, int ot)
+ppc_linux_can_use_hw_breakpoint (struct target_ops *self,
+                                int type, int cnt, int ot)
 {
   int total_hw_wp, total_hw_bp;
 
index 9cdbdd53e89387c488d250431acfb0955f5c9b5e..5b54a42fd19c5bb8b3f9f82689d1159c55433b36 100644 (file)
@@ -140,7 +140,8 @@ static int proc_find_memory_regions (find_memory_region_ftype, void *);
 
 static char * procfs_make_note_section (bfd *, int *);
 
-static int procfs_can_use_hw_breakpoint (int, int, int);
+static int procfs_can_use_hw_breakpoint (struct target_ops *self,
+                                        int, int, int);
 
 static void procfs_info_proc (struct target_ops *, char *,
                              enum info_proc_what);
@@ -4834,7 +4835,8 @@ procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag,
    target_can_use_hardware_watchpoint.  */
 
 static int
-procfs_can_use_hw_breakpoint (int type, int cnt, int othertype)
+procfs_can_use_hw_breakpoint (struct target_ops *self,
+                             int type, int cnt, int othertype)
 {
   /* Due to the way that proc_set_watchpoint() is implemented, host
      and target pointers must be of the same size.  If they are not,
index 0bcfb1f69d601bf3542f252cae71aa914723829c..4cd12d868924ae37bef68f1af498067312520f78 100644 (file)
@@ -1407,7 +1407,8 @@ m32r_stop (ptid_t ptid)
    implements the target_can_use_hardware_watchpoint macro.  */
 
 static int
-m32r_can_use_hw_watchpoint (int type, int cnt, int othertype)
+m32r_can_use_hw_watchpoint (struct target_ops *self,
+                           int type, int cnt, int othertype)
 {
   return sdi_desc != NULL && cnt < max_access_breaks;
 }
index 8dde5cc210ffb3a10719f31c34de9e2281853c18..2e2116c504652f465e8299b919855333d386193f 100644 (file)
@@ -2391,7 +2391,8 @@ mips_remove_breakpoint (struct target_ops *ops, struct gdbarch *gdbarch,
    implements the target_can_use_hardware_watchpoint macro.  */
 
 static int
-mips_can_use_watchpoint (int type, int cnt, int othertype)
+mips_can_use_watchpoint (struct target_ops *self,
+                        int type, int cnt, int othertype)
 {
   return cnt < MAX_LSI_BREAKPOINTS && strcmp (target_shortname, "lsi") == 0;
 }
index fb90c5591ac676cba1bbeae26b0a2159585a7d84..0677fa4c95b2b4599db5f0da11ed7f3a0da5fa65 100644 (file)
@@ -8270,7 +8270,8 @@ remote_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
 }
 
 static int
-remote_check_watch_resources (int type, int cnt, int ot)
+remote_check_watch_resources (struct target_ops *self,
+                             int type, int cnt, int ot)
 {
   if (type == bp_hardware_breakpoint)
     {
index 8cc9060baece90a7585259753d921de3a0fee906..ae00a513f7a5e46ae2b7438c86e81f365d2b2c45 100644 (file)
@@ -557,7 +557,8 @@ s390_remove_watchpoint (CORE_ADDR addr, int len, int type,
 }
 
 static int
-s390_can_use_hw_breakpoint (int type, int cnt, int othertype)
+s390_can_use_hw_breakpoint (struct target_ops *self,
+                           int type, int cnt, int othertype)
 {
   return type == bp_hardware_watchpoint;
 }
index 71c1643c550b771e094d357eb5e2159a2e2df5b6..d80b78c36e106983a75e5773440921f0967c3a9e 100644 (file)
@@ -624,7 +624,8 @@ spu_xfer_partial (struct target_ops *ops,
 
 /* Override the to_can_use_hw_breakpoint routine.  */
 static int
-spu_can_use_hw_breakpoint (int type, int cnt, int othertype)
+spu_can_use_hw_breakpoint (struct target_ops *self,
+                          int type, int cnt, int othertype)
 {
   return 0;
 }
index 73531e1e89aa8499683280a0c60857589f8ae78f..53f3783339d771ac53e0b72607ff86aa76d70b48 100644 (file)
@@ -100,7 +100,8 @@ static int debug_to_insert_breakpoint (struct target_ops *, struct gdbarch *,
 static int debug_to_remove_breakpoint (struct target_ops *, struct gdbarch *,
                                       struct bp_target_info *);
 
-static int debug_to_can_use_hw_breakpoint (int, int, int);
+static int debug_to_can_use_hw_breakpoint (struct target_ops *self,
+                                          int, int, int);
 
 static int debug_to_insert_hw_breakpoint (struct gdbarch *,
                                          struct bp_target_info *);
@@ -734,7 +735,7 @@ update_current_target (void)
            (void (*) (struct target_ops *))
            target_ignore);
   de_fault (to_can_use_hw_breakpoint,
-           (int (*) (int, int, int))
+           (int (*) (struct target_ops *, int, int, int))
            return_zero);
   de_fault (to_insert_hw_breakpoint,
            (int (*) (struct gdbarch *, struct bp_target_info *))
@@ -4620,11 +4621,13 @@ debug_to_remove_breakpoint (struct target_ops *ops, struct gdbarch *gdbarch,
 }
 
 static int
-debug_to_can_use_hw_breakpoint (int type, int cnt, int from_tty)
+debug_to_can_use_hw_breakpoint (struct target_ops *self,
+                               int type, int cnt, int from_tty)
 {
   int retval;
 
-  retval = debug_target.to_can_use_hw_breakpoint (type, cnt, from_tty);
+  retval = debug_target.to_can_use_hw_breakpoint (&debug_target,
+                                                 type, cnt, from_tty);
 
   fprintf_unfiltered (gdb_stdlog,
                      "target_can_use_hw_breakpoint (%ld, %ld, %ld) = %ld\n",
index 1e8d6122d034389ae12f65a6a7831be8904f1fd5..e2002861fc473cbb4d0540d315dcabd040911c69 100644 (file)
@@ -450,7 +450,7 @@ struct target_ops
     int (*to_remove_breakpoint) (struct target_ops *, struct gdbarch *,
                                 struct bp_target_info *)
       TARGET_DEFAULT_FUNC (memory_remove_breakpoint);
-    int (*to_can_use_hw_breakpoint) (int, int, int);
+    int (*to_can_use_hw_breakpoint) (struct target_ops *, int, int, int);
     int (*to_ranged_break_num_registers) (struct target_ops *);
     int (*to_insert_hw_breakpoint) (struct gdbarch *, struct bp_target_info *);
     int (*to_remove_hw_breakpoint) (struct gdbarch *, struct bp_target_info *);
@@ -1595,7 +1595,8 @@ extern char *target_thread_name (struct thread_info *);
    (including this one?).  OTHERTYPE is who knows what...  */
 
 #define target_can_use_hardware_watchpoint(TYPE,CNT,OTHERTYPE) \
- (*current_target.to_can_use_hw_breakpoint) (TYPE, CNT, OTHERTYPE);
+ (*current_target.to_can_use_hw_breakpoint) (&current_target,  \
+                                            TYPE, CNT, OTHERTYPE);
 
 /* Returns the number of debug registers needed to watch the given
    memory region, or zero if not supported.  */
This page took 0.044906 seconds and 4 git commands to generate.