diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-05-27 14:58:38 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-05-27 14:58:38 -0400 |
commit | 055c879fcf242e43a6ef8190f83905109922da93 (patch) | |
tree | 540862da9c8482b7adfe5151f0d32f42d2445cdd | |
parent | 240edef62f0cb5c6cb3dc6da9e35bd8f8af69e01 (diff) | |
download | gdb-055c879fcf242e43a6ef8190f83905109922da93.zip gdb-055c879fcf242e43a6ef8190f83905109922da93.tar.gz gdb-055c879fcf242e43a6ef8190f83905109922da93.tar.bz2 |
gdb: remove iterate_over_bp_locations function
Remove it, change users (well, a single one) to use all_bp_locations.
This requires moving all_bp_locations to breakpoint.h to expose it.
gdb/ChangeLog:
* breakpoint.h (iterate_over_bp_locations): Remove. Update
users to use all_bp_locations.
(all_bp_locations): New.
* breakpoint.c (all_bp_locations): Make non-static.
(iterate_over_bp_locations): Remove.
Change-Id: Iaf1f716d6c2c5b2975579b3dc113a86f5d0975be
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/breakpoint.c | 13 | ||||
-rw-r--r-- | gdb/breakpoint.h | 7 | ||||
-rw-r--r-- | gdb/record-full.c | 26 |
4 files changed, 25 insertions, 29 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7bca8f0..66a16df 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,13 @@ 2021-05-27 Simon Marchi <simon.marchi@polymtl.ca> + * breakpoint.h (iterate_over_bp_locations): Remove. Update + users to use all_bp_locations. + (all_bp_locations): New. + * breakpoint.c (all_bp_locations): Make non-static. + (iterate_over_bp_locations): Remove. + +2021-05-27 Simon Marchi <simon.marchi@polymtl.ca> + * breakpoint.h (iterate_over_breakpoints): Remove. Update callers to use all_breakpoints or all_breakpoints_safe. (breakpoint_range, all_breakpoints, breakpoint_safe_range, diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 401367d..4d5c0dd 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -521,7 +521,9 @@ all_tracepoints () static std::vector<bp_location *> bp_locations; -static const std::vector<bp_location *> & +/* See breakpoint.h. */ + +const std::vector<bp_location *> & all_bp_locations () { return bp_locations; @@ -2913,15 +2915,6 @@ insert_breakpoints (void) update_global_location_list (UGLL_INSERT); } -/* Invoke CALLBACK for each of bp_location. */ - -void -iterate_over_bp_locations (gdb::function_view<void (bp_location *)> callback) -{ - for (bp_location *loc : all_bp_locations ()) - callback (loc); -} - /* This is used when we need to synch breakpoint conditions between GDB and the target. It is the case with deleting and disabling of breakpoints when using always-inserted mode. */ diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index ffe0424..e40504f 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -1313,9 +1313,6 @@ extern void breakpoint_init_inferior (enum inf_context); extern void breakpoint_auto_delete (bpstat); -extern void iterate_over_bp_locations - (gdb::function_view<void (bp_location *)> callback); - /* Return the chain of command lines to execute when this breakpoint is hit. */ extern struct command_line *breakpoint_commands (struct breakpoint *b); @@ -1755,6 +1752,10 @@ using tracepoint_range = next_adapter<breakpoint, tracepoint_iterator>; tracepoint_range all_tracepoints (); +/* Return a range to iterate over all breakpoint locations. */ + +const std::vector<bp_location *> &all_bp_locations (); + /* Nonzero if the specified PC cannot be a location where functions have been inlined. */ diff --git a/gdb/record-full.c b/gdb/record-full.c index 03e39ee..e3b8abc 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -1719,21 +1719,6 @@ struct record_full_breakpoint active. */ static std::vector<record_full_breakpoint> record_full_breakpoints; -static void -record_full_sync_record_breakpoints (struct bp_location *loc) -{ - if (loc->loc_type != bp_loc_software_breakpoint) - return; - - if (loc->inserted) - { - record_full_breakpoints.emplace_back - (loc->target_info.placed_address_space, - loc->target_info.placed_address, - 1); - } -} - /* Sync existing breakpoints to record_full_breakpoints. */ static void @@ -1741,7 +1726,16 @@ record_full_init_record_breakpoints (void) { record_full_breakpoints.clear (); - iterate_over_bp_locations (record_full_sync_record_breakpoints); + for (bp_location *loc : all_bp_locations ()) + { + if (loc->loc_type != bp_loc_software_breakpoint) + continue; + + if (loc->inserted) + record_full_breakpoints.emplace_back + (loc->target_info.placed_address_space, + loc->target_info.placed_address, 1); + } } /* Behavior is conditional on RECORD_FULL_IS_REPLAY. We will not actually |