aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2007-05-11 20:01:31 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2007-05-11 20:01:31 +0000
commitaa67235e6e50c06efdbc751137d2afbe0b37b80d (patch)
tree2828be466a8d302c542b322853d546abc6e35378 /gdb/breakpoint.c
parent83547f02b76a49b6899e65a5302e72e0a5ef8fe8 (diff)
downloadgdb-aa67235e6e50c06efdbc751137d2afbe0b37b80d.zip
gdb-aa67235e6e50c06efdbc751137d2afbe0b37b80d.tar.gz
gdb-aa67235e6e50c06efdbc751137d2afbe0b37b80d.tar.bz2
* breakpoint.c (remove_breakpoint): Do not remove software
breakpoints in unmapped overlay sections.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c8
1 files changed, 7 insertions, 1 deletions
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
{