From 88f7da0511bc14bcc93b34bb642f16a66412e347 Mon Sep 17 00:00:00 2001 From: Kevin Buettner Date: Fri, 19 Mar 2004 20:49:43 +0000 Subject: [PATCH] * breakpoint.c (adjust_breakpoint_address): Don't adjust breakpoint address for watchpoints or the catch eventpoints. Add new paramter ``bptype''. Adjust all callers. --- gdb/ChangeLog | 6 ++++++ gdb/breakpoint.c | 29 +++++++++++++++++++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c0f256e..dfc5524 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 a8696bb..9a21f09 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 -- 2.7.4