From: Kevin Buettner Date: Fri, 19 Mar 2004 20:49:43 +0000 (+0000) Subject: * breakpoint.c (adjust_breakpoint_address): Don't adjust X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=88f7da0511bc14bcc93b34bb642f16a66412e347;p=binutils-gdb.git * breakpoint.c (adjust_breakpoint_address): Don't adjust breakpoint address for watchpoints or the catch eventpoints. Add new paramter ``bptype''. Adjust all callers. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c0f256effec..dfc55244b79 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2004-03-19 Kevin Buettner + + * breakpoint.c (adjust_breakpoint_address): Don't adjust + breakpoint address for watchpoints or the catch eventpoints. + Add new paramter ``bptype''. Adjust all callers. + 2004-03-19 Andrew Cagney * config/pa/tm-hppa.h (GDB_TARGET_IS_HPPA): Delete unused macro. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index a8696bb1f05..9a21f09a02a 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -99,7 +99,8 @@ static void check_duplicates (struct breakpoint *); static void breakpoint_adjustment_warning (CORE_ADDR, CORE_ADDR, int, int); -static CORE_ADDR adjust_breakpoint_address (CORE_ADDR bpaddr); +static CORE_ADDR adjust_breakpoint_address (CORE_ADDR bpaddr, + enum bptype bptype); static void describe_other_breakpoints (CORE_ADDR, asection *); @@ -3947,13 +3948,25 @@ breakpoint_adjustment_warning (CORE_ADDR from_addr, CORE_ADDR to_addr, this function is simply the identity function. */ static CORE_ADDR -adjust_breakpoint_address (CORE_ADDR bpaddr) +adjust_breakpoint_address (CORE_ADDR bpaddr, enum bptype bptype) { if (!gdbarch_adjust_breakpoint_address_p (current_gdbarch)) { /* Very few targets need any kind of breakpoint adjustment. */ return bpaddr; } + else if (bptype == bp_watchpoint + || bptype == bp_hardware_watchpoint + || bptype == bp_read_watchpoint + || bptype == bp_access_watchpoint + || bptype == bp_catch_fork + || bptype == bp_catch_vfork + || bptype == bp_catch_exec) + { + /* Watchpoints and the various bp_catch_* eventpoints should not + have their addresses modified. */ + return bpaddr; + } else { CORE_ADDR adjusted_bpaddr; @@ -4062,7 +4075,8 @@ set_raw_breakpoint (struct symtab_and_line sal, enum bptype bptype) memset (b, 0, sizeof (*b)); b->loc = allocate_bp_location (b, bptype); b->loc->requested_address = sal.pc; - b->loc->address = adjust_breakpoint_address (b->loc->requested_address); + b->loc->address = adjust_breakpoint_address (b->loc->requested_address, + bptype); if (sal.symtab == NULL) b->source_file = NULL; else @@ -4622,7 +4636,8 @@ set_longjmp_resume_breakpoint (CORE_ADDR pc, struct frame_id frame_id) if (b->type == bp_longjmp_resume) { b->loc->requested_address = pc; - b->loc->address = adjust_breakpoint_address (b->loc->requested_address); + b->loc->address = adjust_breakpoint_address (b->loc->requested_address, + b->type); b->enable_state = bp_enabled; b->frame_id = frame_id; check_duplicates (b); @@ -5879,7 +5894,8 @@ watch_command_1 (char *arg, int accessflag, int from_tty) scope_breakpoint->loc->requested_address = get_frame_pc (prev_frame); scope_breakpoint->loc->address - = adjust_breakpoint_address (scope_breakpoint->loc->requested_address); + = adjust_breakpoint_address (scope_breakpoint->loc->requested_address, + scope_breakpoint->type); /* The scope breakpoint is related to the watchpoint. We will need to act on them together. */ @@ -7185,7 +7201,8 @@ breakpoint_re_set_one (void *bint) b->line_number = sals.sals[i].line; b->loc->requested_address = sals.sals[i].pc; b->loc->address - = adjust_breakpoint_address (b->loc->requested_address); + = adjust_breakpoint_address (b->loc->requested_address, + b->type); /* Used to check for duplicates here, but that can cause trouble, as it doesn't check for disabled