diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2008-06-28 09:42:15 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2008-06-28 09:42:15 +0000 |
commit | 20874c92f88d70f91bbc166ccb8d2f78f09d90a4 (patch) | |
tree | 4e7e123ebc40feaf8a12d48b36a7b4a6dfd19e9d /gdb/breakpoint.h | |
parent | 2a9bd7a88c03fc8e9fea49f9e4c09df819b4ec23 (diff) | |
download | gdb-20874c92f88d70f91bbc166ccb8d2f78f09d90a4.zip gdb-20874c92f88d70f91bbc166ccb8d2f78f09d90a4.tar.gz gdb-20874c92f88d70f91bbc166ccb8d2f78f09d90a4.tar.bz2 |
* breakpoint.c (moribund_locations): New.
(bpstat_stop_status): Process moribund locations.
(update_global_location_list): Add removed
locations to moribund_locations.
(breakpoint_retire_moribund): New.
* breakpoint.h (struct bp_location): New field
events_till_retirement.
(breakpoint_retire_moribund): Declare.
* thread.c (thread_count): New.
* infrun.c (handle_inferior_event): Call
breakpoint_retire_moribund.
* gdbthread.h (thread_count): Declare.
Diffstat (limited to 'gdb/breakpoint.h')
-rw-r--r-- | gdb/breakpoint.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 80544e4..2c98d64 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -298,6 +298,17 @@ struct bp_location /* Similarly, for the breakpoint at an overlay's LMA, if necessary. */ struct bp_target_info overlay_target_info; + + /* In a non-stop mode, it's possible that we delete a breakpoint, + but as we do that, some still running thread hits that breakpoint. + For that reason, we need to keep locations belonging to deleted + breakpoints for a bit, so that don't report unexpected SIGTRAP. + We can't keep such locations forever, so we use a heuristic -- + after we process certain number of inferior events since + breakpoint was deleted, we retire all locations of that breakpoint. + This variable keeps a number of events still to go, when + it becomes 0 this location is retired. */ + int events_till_retirement; }; /* This structure is a collection of function pointers that, if available, @@ -865,4 +876,9 @@ void breakpoint_restore_shadows (gdb_byte *buf, ULONGEST memaddr, extern int breakpoints_always_inserted_mode (void); +/* Called each time new event from target is processed. + Retires previously deleted breakpoint locations that + in our opinion won't ever trigger. */ +extern void breakpoint_retire_moribund (void); + #endif /* !defined (BREAKPOINT_H) */ |