From 4aa7a7f553f9bc09fa503bf82d41038763319479 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Fri, 8 Oct 2004 17:30:48 +0000 Subject: 2004-10-08 Jeff Johnston * target.h (to_stopped_data_address): Change prototype to take a CORE_ADDR pointer and return an int. * target.c (update_current_target): Change to_stopped_data_address to match new prototype. (debug_to_stopped_data_address): Change appropriately. * breakpoint.c (bpstat_stop_status): Change call to target_stopped_data_address to use new prototype. * frv-tdep.c (frv_have_stopped_data_address): New function. (frv_stopped_data_address): Change to new prototype and functionality. * ia64-linux-nat.c (ia64_stopped_data_address): Change to new prototype and functionality. (ia64_stopped_by_watchpoint): New function. * i386-nat.c (i386_stopped_data_address): Change to new prototype and functionality. (i386_stopped_by_watchpoint): New function. * remote.c (remote_stopped_data_address): Change to new prototype and functionality. * remote-m32r-sdi.c (m32r_stopped_data_address): Ditto. * config/frv/tm-frv.h (frv_stopped_data_address): Change prototype. (STOPPED_BY_WATCHPOINT): Change to use frv_have_stopped_data_address. * config/i386/nm-i386.h (STOPPED_BY_WATCHPOINT): Change to use new i386_stopped_by_watchpoint function. (i386_stopped_by_watchpoint): New prototype. (i386_stoppped_data_address): Change to new prototype. * config/ia64/nm-linux.h (STOPPED_BY_WATCHPOINT): Change to use new ia64_stopped_by_watchpoint function. (ia64_stopped_by_watchpoint): New prototype. (ia64_stopped_data_address): Ditto. --- gdb/target.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'gdb/target.c') diff --git a/gdb/target.c b/gdb/target.c index 7176dbe..ce51f3d 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -127,7 +127,7 @@ static int debug_to_remove_watchpoint (CORE_ADDR, int, int); static int debug_to_stopped_by_watchpoint (void); -static CORE_ADDR debug_to_stopped_data_address (void); +static int debug_to_stopped_data_address (struct target_ops *, CORE_ADDR *); static int debug_to_region_size_ok_for_hw_watchpoint (int); @@ -524,7 +524,7 @@ update_current_target (void) (int (*) (void)) return_zero); de_fault (to_stopped_data_address, - (CORE_ADDR (*) (void)) + (int (*) (struct target_ops *, CORE_ADDR *)) return_zero); de_fault (to_region_size_ok_for_hw_watchpoint, default_region_size_ok_for_hw_watchpoint); @@ -1011,6 +1011,19 @@ target_write_memory (CORE_ADDR memaddr, char *myaddr, int len) return target_xfer_memory (memaddr, myaddr, len, 1); } +#ifndef target_stopped_data_address_p +int +target_stopped_data_address_p (struct target_ops *target) +{ + if (target->to_stopped_data_address == return_zero + || (target->to_stopped_data_address == debug_to_stopped_data_address + && debug_target.to_stopped_data_address == return_zero)) + return 0; + else + return 1; +} +#endif + static int trust_readonly = 0; /* Move memory to or from the targets. The top target gets priority; @@ -2069,16 +2082,17 @@ debug_to_stopped_by_watchpoint (void) return retval; } -static CORE_ADDR -debug_to_stopped_data_address (void) +static int +debug_to_stopped_data_address (struct target_ops *target, CORE_ADDR *addr) { - CORE_ADDR retval; + int retval; - retval = debug_target.to_stopped_data_address (); + retval = debug_target.to_stopped_data_address (target, addr); fprintf_unfiltered (gdb_stdlog, - "target_stopped_data_address () = 0x%lx\n", - (unsigned long) retval); + "target_stopped_data_address ([0x%lx]) = %ld\n", + (unsigned long)*addr, + (unsigned long)retval); return retval; } -- cgit v1.1