From 7bb99c53837248382434ccf26f50b42e69d0b874 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 17 Dec 2013 21:29:31 -0700 Subject: [PATCH] Add target_ops argument to to_insert_watchpoint 2014-02-19 Tom Tromey * target.h (struct target_ops) : Add argument. (target_insert_watchpoint): Add argument. * target.c (debug_to_insert_watchpoint): Add argument. (update_current_target): Update. * s390-linux-nat.c (s390_insert_watchpoint): Add 'self' argument. * remote.c (remote_insert_watchpoint): Add 'self' argument. * remote-mips.c (mips_insert_watchpoint): Add 'self' argument. * remote-m32r-sdi.c (m32r_insert_watchpoint): Add 'self' argument. * procfs.c (procfs_insert_watchpoint): Add 'self' argument. * ppc-linux-nat.c (ppc_linux_insert_watchpoint): Add 'self' argument. * nto-procfs.c (procfs_insert_hw_watchpoint): Add 'self' argument. (procfs_insert_hw_watchpoint): Add 'self' argument. * mips-linux-nat.c (mips_linux_insert_watchpoint): Add 'self' argument. * inf-ttrace.c (inf_ttrace_insert_watchpoint): Add 'self' argument. * ia64-linux-nat.c (ia64_linux_insert_watchpoint): Add 'self' argument. * i386-nat.c (i386_insert_watchpoint): Add 'self' argument. * arm-linux-nat.c (arm_linux_insert_watchpoint): Add 'self' argument. * aarch64-linux-nat.c (aarch64_linux_insert_watchpoint): Add 'self' argument. --- gdb/ChangeLog | 28 ++++++++++++++++++++++++++++ gdb/aarch64-linux-nat.c | 3 ++- gdb/arm-linux-nat.c | 3 ++- gdb/i386-nat.c | 3 ++- gdb/ia64-linux-nat.c | 3 ++- gdb/inf-ttrace.c | 3 ++- gdb/mips-linux-nat.c | 3 ++- gdb/nto-procfs.c | 6 ++++-- gdb/ppc-linux-nat.c | 3 ++- gdb/procfs.c | 3 ++- gdb/remote-m32r-sdi.c | 3 ++- gdb/remote-mips.c | 3 ++- gdb/remote.c | 3 ++- gdb/s390-linux-nat.c | 3 ++- gdb/target.c | 12 ++++++++---- gdb/target.h | 6 ++++-- 16 files changed, 68 insertions(+), 20 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 38ddd87c47a..ac6184b68cb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,31 @@ +2014-02-19 Tom Tromey + + * target.h (struct target_ops) : Add + argument. + (target_insert_watchpoint): Add argument. + * target.c (debug_to_insert_watchpoint): Add argument. + (update_current_target): Update. + * s390-linux-nat.c (s390_insert_watchpoint): Add 'self' argument. + * remote.c (remote_insert_watchpoint): Add 'self' argument. + * remote-mips.c (mips_insert_watchpoint): Add 'self' argument. + * remote-m32r-sdi.c (m32r_insert_watchpoint): Add 'self' argument. + * procfs.c (procfs_insert_watchpoint): Add 'self' argument. + * ppc-linux-nat.c (ppc_linux_insert_watchpoint): Add 'self' + argument. + * nto-procfs.c (procfs_insert_hw_watchpoint): Add 'self' argument. + (procfs_insert_hw_watchpoint): Add 'self' argument. + * mips-linux-nat.c (mips_linux_insert_watchpoint): Add 'self' + argument. + * inf-ttrace.c (inf_ttrace_insert_watchpoint): Add 'self' + argument. + * ia64-linux-nat.c (ia64_linux_insert_watchpoint): Add 'self' + argument. + * i386-nat.c (i386_insert_watchpoint): Add 'self' argument. + * arm-linux-nat.c (arm_linux_insert_watchpoint): Add 'self' + argument. + * aarch64-linux-nat.c (aarch64_linux_insert_watchpoint): Add + 'self' argument. + 2014-02-19 Tom Tromey * target.h (struct target_ops) : Add diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c index d5090314e2e..a69e31fd104 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c @@ -1340,7 +1340,8 @@ aarch64_handle_watchpoint (int type, CORE_ADDR addr, int len, int is_insert) of the type TYPE. Return 0 on success, -1 on failure. */ static int -aarch64_linux_insert_watchpoint (CORE_ADDR addr, int len, int type, +aarch64_linux_insert_watchpoint (struct target_ops *self, + CORE_ADDR addr, int len, int type, struct expression *cond) { int ret; diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c index d964009391d..c4b34cdf375 100644 --- a/gdb/arm-linux-nat.c +++ b/gdb/arm-linux-nat.c @@ -1108,7 +1108,8 @@ arm_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) /* Insert a Hardware breakpoint. */ static int -arm_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, +arm_linux_insert_watchpoint (struct target_ops *self, + CORE_ADDR addr, int len, int rw, struct expression *cond) { struct lwp_info *lp; diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c index e1306702c96..cd766cf1322 100644 --- a/gdb/i386-nat.c +++ b/gdb/i386-nat.c @@ -589,7 +589,8 @@ i386_update_inferior_debug_regs (struct i386_debug_reg_state *new_state) of the type TYPE. Return 0 on success, -1 on failure. */ static int -i386_insert_watchpoint (CORE_ADDR addr, int len, int type, +i386_insert_watchpoint (struct target_ops *self, + CORE_ADDR addr, int len, int type, struct expression *cond) { struct i386_debug_reg_state *state diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c index 31ee479029a..ccd55b29673 100644 --- a/gdb/ia64-linux-nat.c +++ b/gdb/ia64-linux-nat.c @@ -542,7 +542,8 @@ is_power_of_2 (int val) } static int -ia64_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, +ia64_linux_insert_watchpoint (struct target_ops *self, + CORE_ADDR addr, int len, int rw, struct expression *cond) { struct lwp_info *lp; diff --git a/gdb/inf-ttrace.c b/gdb/inf-ttrace.c index 7e77424c97f..919515f7fbc 100644 --- a/gdb/inf-ttrace.c +++ b/gdb/inf-ttrace.c @@ -314,7 +314,8 @@ inf_ttrace_disable_page_protections (pid_t pid) type TYPE. */ static int -inf_ttrace_insert_watchpoint (CORE_ADDR addr, int len, int type, +inf_ttrace_insert_watchpoint (struct target_ops *self, + CORE_ADDR addr, int len, int type, struct expression *cond) { const int pagesize = inf_ttrace_page_dict.pagesize; diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c index 9c1c8cb4459..d8781fc6543 100644 --- a/gdb/mips-linux-nat.c +++ b/gdb/mips-linux-nat.c @@ -645,7 +645,8 @@ mips_linux_new_thread (struct lwp_info *lp) watch. Return zero on success. */ static int -mips_linux_insert_watchpoint (CORE_ADDR addr, int len, int type, +mips_linux_insert_watchpoint (struct target_ops *self, + CORE_ADDR addr, int len, int type, struct expression *cond) { struct pt_watch_regs regs; diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c index 7407efc63eb..0a7ed55f752 100644 --- a/gdb/nto-procfs.c +++ b/gdb/nto-procfs.c @@ -70,7 +70,8 @@ static ptid_t do_attach (ptid_t ptid); 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, +static int procfs_insert_hw_watchpoint (struct target_ops *self, + CORE_ADDR addr, int len, int type, struct expression *cond); static int procfs_remove_hw_watchpoint (struct target_ops *self, @@ -1505,7 +1506,8 @@ procfs_remove_hw_watchpoint (struct target_ops *self, } static int -procfs_insert_hw_watchpoint (CORE_ADDR addr, int len, int type, +procfs_insert_hw_watchpoint (struct target_ops *self, + CORE_ADDR addr, int len, int type, struct expression *cond) { return procfs_hw_watchpoint (addr, len, type); diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index b4eae9d7d3b..f77d225d763 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -2076,7 +2076,8 @@ create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr, } static int -ppc_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, +ppc_linux_insert_watchpoint (struct target_ops *self, + CORE_ADDR addr, int len, int rw, struct expression *cond) { struct lwp_info *lp; diff --git a/gdb/procfs.c b/gdb/procfs.c index 26e7ac3fea4..e1de2ac2bc4 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -4899,7 +4899,8 @@ procfs_stopped_data_address (struct target_ops *targ, CORE_ADDR *addr) } static int -procfs_insert_watchpoint (CORE_ADDR addr, int len, int type, +procfs_insert_watchpoint (struct target_ops *self, + CORE_ADDR addr, int len, int type, struct expression *cond) { if (!target_have_steppable_watchpoint diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c index 6d8eab0c053..37649e4a5d7 100644 --- a/gdb/remote-m32r-sdi.c +++ b/gdb/remote-m32r-sdi.c @@ -1418,7 +1418,8 @@ m32r_can_use_hw_watchpoint (struct target_ops *self, watchpoint. */ static int -m32r_insert_watchpoint (CORE_ADDR addr, int len, int type, +m32r_insert_watchpoint (struct target_ops *self, + CORE_ADDR addr, int len, int type, struct expression *cond) { int i; diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index 174e9b3e66d..e8ef4494104 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -2426,7 +2426,8 @@ calculate_mask (CORE_ADDR addr, int len) watchpoint. */ static int -mips_insert_watchpoint (CORE_ADDR addr, int len, int type, +mips_insert_watchpoint (struct target_ops *self, + CORE_ADDR addr, int len, int type, struct expression *cond) { if (mips_set_breakpoint (addr, len, type)) diff --git a/gdb/remote.c b/gdb/remote.c index c797530cb79..d851bf798ab 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -8166,7 +8166,8 @@ watchpoint_to_Z_packet (int type) } static int -remote_insert_watchpoint (CORE_ADDR addr, int len, int type, +remote_insert_watchpoint (struct target_ops *self, + CORE_ADDR addr, int len, int type, struct expression *cond) { struct remote_state *rs = get_remote_state (); diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c index 8a187aca442..342d6ad86a7 100644 --- a/gdb/s390-linux-nat.c +++ b/gdb/s390-linux-nat.c @@ -508,7 +508,8 @@ s390_fix_watch_points (struct lwp_info *lp) } static int -s390_insert_watchpoint (CORE_ADDR addr, int len, int type, +s390_insert_watchpoint (struct target_ops *self, + CORE_ADDR addr, int len, int type, struct expression *cond) { struct lwp_info *lp; diff --git a/gdb/target.c b/gdb/target.c index 68504100ddd..d73792843c4 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -111,7 +111,8 @@ static int debug_to_remove_hw_breakpoint (struct target_ops *self, struct gdbarch *, struct bp_target_info *); -static int debug_to_insert_watchpoint (CORE_ADDR, int, int, +static int debug_to_insert_watchpoint (struct target_ops *self, + CORE_ADDR, int, int, struct expression *); static int debug_to_remove_watchpoint (struct target_ops *self, @@ -749,7 +750,8 @@ update_current_target (void) struct bp_target_info *)) return_minus_one); de_fault (to_insert_watchpoint, - (int (*) (CORE_ADDR, int, int, struct expression *)) + (int (*) (struct target_ops *, CORE_ADDR, int, int, + struct expression *)) return_minus_one); de_fault (to_remove_watchpoint, (int (*) (struct target_ops *, CORE_ADDR, int, int, @@ -4754,12 +4756,14 @@ debug_to_remove_hw_breakpoint (struct target_ops *self, } static int -debug_to_insert_watchpoint (CORE_ADDR addr, int len, int type, +debug_to_insert_watchpoint (struct target_ops *self, + CORE_ADDR addr, int len, int type, struct expression *cond) { int retval; - retval = debug_target.to_insert_watchpoint (addr, len, type, cond); + retval = debug_target.to_insert_watchpoint (&debug_target, + addr, len, type, cond); fprintf_unfiltered (gdb_stdlog, "target_insert_watchpoint (%s, %d, %d, %s) = %ld\n", diff --git a/gdb/target.h b/gdb/target.h index defb78463a2..69b8b7749d2 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -461,7 +461,8 @@ struct target_ops provided with the corresponding target_* macros. */ int (*to_remove_watchpoint) (struct target_ops *, CORE_ADDR, int, int, struct expression *); - int (*to_insert_watchpoint) (CORE_ADDR, int, int, struct expression *); + int (*to_insert_watchpoint) (struct target_ops *, + CORE_ADDR, int, int, struct expression *); int (*to_insert_mask_watchpoint) (struct target_ops *, CORE_ADDR, CORE_ADDR, int); @@ -1615,7 +1616,8 @@ extern char *target_thread_name (struct thread_info *); -1 for failure. */ #define target_insert_watchpoint(addr, len, type, cond) \ - (*current_target.to_insert_watchpoint) (addr, len, type, cond) + (*current_target.to_insert_watchpoint) (¤t_target, \ + addr, len, type, cond) #define target_remove_watchpoint(addr, len, type, cond) \ (*current_target.to_remove_watchpoint) (¤t_target, \ -- 2.30.2