diff options
author | Pedro Alves <pedro@codesourcery.com> | 2008-07-08 10:59:57 +0000 |
---|---|---|
committer | Pedro Alves <pedro@codesourcery.com> | 2008-07-08 10:59:57 +0000 |
commit | e58e16208228dc878391a692f1446a5effb2b1db (patch) | |
tree | 1a2f9e7d52a39336ef17797810da2e03f11ad75a /gdb/breakpoint.c | |
parent | d162d338475a9f57b99a2bfa5d62cc339eb47ed6 (diff) | |
download | gdb-e58e16208228dc878391a692f1446a5effb2b1db.tar.gz |
* breakpoint.c (mark_breakpoints_out): Make public.
(update_breakpoints_after_exec): Don't call mark_breakpoints_out
here. Update comment.
* breakpoint.h (mark_breakpoints_out): Declare.
* linux-nat.c (linux_handle_extended_wait): On
TARGET_WAITKIND_EXECD, call mark_breakpoints_out.
* inf-ttrace.c (inf_ttrace_wait): Likewise.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index e774bca940b..9d7bf71576d 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -188,8 +188,6 @@ static int single_step_breakpoint_inserted_here_p (CORE_ADDR pc); static void free_bp_location (struct bp_location *loc); -static void mark_breakpoints_out (void); - static struct bp_location * allocate_bp_location (struct breakpoint *bpt, enum bptype bp_type); @@ -1443,12 +1441,19 @@ update_breakpoints_after_exec (void) { struct breakpoint *b; struct breakpoint *temp; + struct bp_location *bploc; struct cleanup *cleanup; - /* Doing this first prevents the badness of having delete_breakpoint() - write a breakpoint's current "shadow contents" to lift the bp. That - shadow is NOT valid after an exec()! */ - mark_breakpoints_out (); + /* We're about to delete breakpoints from GDB's lists. If the + INSERTED flag is true, GDB will try to lift the breakpoints by + writing the breakpoints' "shadow contents" back into memory. The + "shadow contents" are NOT valid after an exec, so GDB should not + do that. Instead, the target is responsible from marking + breakpoints out as soon as it detects an exec. We don't do that + here instead, because there may be other attempts to delete + breakpoints after detecting an exec and before reaching here. */ + ALL_BP_LOCATIONS (bploc) + gdb_assert (!bploc->inserted); /* The binary we used to debug is now gone, and we're updating breakpoints for the new binary. Until we're done, we should not @@ -1699,7 +1704,7 @@ remove_breakpoint (struct bp_location *b, insertion_state_t is) /* Clear the "inserted" flag in all breakpoints. */ -static void +void mark_breakpoints_out (void) { struct bp_location *bpt; |