From: Ulrich Weigand Date: Fri, 11 May 2007 20:01:31 +0000 (+0000) Subject: * breakpoint.c (remove_breakpoint): Do not remove software X-Git-Tag: binutils-2_18-branchpoint~778 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa67235e6e50c06efdbc751137d2afbe0b37b80d;p=platform%2Fupstream%2Fbinutils.git * breakpoint.c (remove_breakpoint): Do not remove software breakpoints in unmapped overlay sections. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index be0bc8f..a78ade4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2007-05-11 Ulrich Weigand + * breakpoint.c (remove_breakpoint): Do not remove software + breakpoints in unmapped overlay sections. + +2007-05-11 Ulrich Weigand + * spu-tdep.c: Include "observer.h". (spu_frame_unwind_cache): Unwind PC through overlay return stubs. (spu_overlay_data): New variable. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 176a17c..59cb151 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -1587,8 +1587,14 @@ remove_breakpoint (struct bp_location *b, insertion_state_t is) don't know what the overlay manager might do. */ if (b->loc_type == bp_loc_hardware_breakpoint) val = target_remove_hw_breakpoint (&b->target_info); - else + + /* However, we should remove *software* breakpoints only + if the section is still mapped, or else we overwrite + wrong code with the saved shadow contents. */ + else if (section_is_mapped (b->section)) val = target_remove_breakpoint (&b->target_info); + else + val = 0; } else {