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
This commit is contained in:
Simon Marchi
2022-05-04 08:14:22 -04:00
committed by Simon Marchi
parent 1653ae5b84
commit 6e9cd73eb5
10 changed files with 55 additions and 151 deletions

View File

@ -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. */