+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.
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;
}
/* 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)
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;
}
/* 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;
}
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;
}
}
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);
}
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;
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);
}
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;
}
}
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;
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);
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,
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;
}
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;
}
}
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)
{
}
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;
}
/* 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;
}
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 *);
(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 *))
}
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",
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 *);
(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) (¤t_target, \
+ TYPE, CNT, OTHERTYPE);
/* Returns the number of debug registers needed to watch the given
memory region, or zero if not supported. */