From 2219d63c86d52fe7f954d8ebf92a4353add7010f Mon Sep 17 00:00:00 2001 From: Kevin Buettner Date: Thu, 3 May 2007 17:42:25 +0000 Subject: * breakpoint.c (set_raw_breakpoint): Adjust breakpoint's address prior to allocating its location. --- gdb/ChangeLog | 5 +++++ gdb/breakpoint.c | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'gdb') diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 67fbdbd..188bed3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2007-05-03 Kevin Buettner + + * breakpoint.c (set_raw_breakpoint): Adjust breakpoint's address + prior to allocating its location. + 2007-05-02 Maciej W. Rozycki * mips-tdep.c (mips_o32_push_dummy_call): Remove conditions diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index c6aaf66..23b5f1d 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -4189,13 +4189,23 @@ struct breakpoint * set_raw_breakpoint (struct symtab_and_line sal, enum bptype bptype) { struct breakpoint *b, *b1; + CORE_ADDR adjusted_address; b = (struct breakpoint *) xmalloc (sizeof (struct breakpoint)); memset (b, 0, sizeof (*b)); + + /* Adjust the breakpoint's address prior to allocating a location. + Once we call allocate_bp_location(), that mostly uninitialized + location will be placed on the location chain. Adjustment of the + breakpoint may cause read_memory_nobpt() to be called and we do + not want its scan of the location chain to find a breakpoint and + location that's only been partially initialized. */ + adjusted_address = adjust_breakpoint_address (sal.pc, bptype); + b->loc = allocate_bp_location (b, bptype); b->loc->requested_address = sal.pc; - b->loc->address = adjust_breakpoint_address (b->loc->requested_address, - bptype); + b->loc->address = adjusted_address; + if (sal.symtab == NULL) b->source_file = NULL; else -- cgit v1.1