summaryrefslogtreecommitdiff
path: root/gdb/objfiles.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2022-05-04 08:14:22 -0400
committerSimon Marchi <simon.marchi@efficios.com>2022-05-05 15:27:26 -0400
commit6e9cd73eb553c372153d6e9ba4934119623fdad3 (patch)
tree1eb62a3689f410c6554d8d94bff6502d1a9a6849 /gdb/objfiles.c
parent1653ae5b8440e2182ac86974b99b603bc15aa163 (diff)
downloadbinutils-gdb-6e9cd73eb553c372153d6e9ba4934119623fdad3.tar.gz
gdb: use gdb::function_view for gdbarch_iterate_over_objfiles_in_search_order callback
A rather straightforward patch to change an instance of callback + void pointer to gdb::function_view, allowing pasing lambdas that capture, and eliminating the need for the untyped pointer. Change-Id: I73ed644e7849945265a2c763f79f5456695b0037
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r--gdb/objfiles.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 3f18e98710b..80f68fda1c1 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -1315,18 +1315,12 @@ shared_objfile_contains_address_p (struct program_space *pspace,
void
default_iterate_over_objfiles_in_search_order
- (struct gdbarch *gdbarch,
- iterate_over_objfiles_in_search_order_cb_ftype *cb,
- void *cb_data, struct objfile *current_objfile)
+ (gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype cb,
+ objfile *current_objfile)
{
- int stop = 0;
-
for (objfile *objfile : current_program_space->objfiles ())
- {
- stop = cb (objfile, cb_data);
- if (stop)
- return;
- }
+ if (cb (objfile))
+ return;
}
/* See objfiles.h. */