summaryrefslogtreecommitdiff
path: root/gdb/solib-svr4.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-05-27 14:58:37 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-05-27 14:58:37 -0400
commit40cb8ca5396e563968fa8465a10173e7c2fd9d84 (patch)
treeaefc927ed2d6358fffd3c6db828751a3fd0996ce /gdb/solib-svr4.c
parentf6d17b2b1c042853b80d790b0c6a10d2b4347faa (diff)
downloadbinutils-gdb-40cb8ca5396e563968fa8465a10173e7c2fd9d84.tar.gz
gdb: add breakpoint::locations method
Add the breakpoint::locations method, which returns a range that can be used to iterate over a breakpoint's locations. This shortens for (bp_location *loc = b->loc; loc != nullptr; loc = loc->next) into for (bp_location *loc : b->locations ()) Change all the places that I found that could use it. gdb/ChangeLog: * breakpoint.h (bp_locations_range): New. (struct breakpoint) <locations>: New. Use where possible. Change-Id: I1ba2f7d93d57e544e1f8609124587dcf2e1da037
Diffstat (limited to 'gdb/solib-svr4.c')
-rw-r--r--gdb/solib-svr4.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 60eeac5f4be..2642e1ad2fd 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -2019,15 +2019,13 @@ svr4_handle_solib_event (void)
static bool
svr4_update_solib_event_breakpoint (struct breakpoint *b)
{
- struct bp_location *loc;
-
if (b->type != bp_shlib_event)
{
/* Continue iterating. */
return false;
}
- for (loc = b->loc; loc != NULL; loc = loc->next)
+ for (bp_location *loc : b->locations ())
{
struct svr4_info *info;
struct probe_and_action *pa;