mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 06:45:56 +08:00
* 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.
This commit is contained in:
@ -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) */
|
||||
|
Reference in New Issue
Block a user