mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-17 16:05:56 +08:00
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:

committed by
Simon Marchi

parent
1653ae5b84
commit
6e9cd73eb5
@ -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. */
|
||||
|
Reference in New Issue
Block a user