aboutsummaryrefslogtreecommitdiff
path: root/gdb/windows-tdep.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/windows-tdep.c
parent1653ae5b8440e2182ac86974b99b603bc15aa163 (diff)
downloadfsf-binutils-gdb-6e9cd73eb553c372153d6e9ba4934119623fdad3.zip
fsf-binutils-gdb-6e9cd73eb553c372153d6e9ba4934119623fdad3.tar.gz
fsf-binutils-gdb-6e9cd73eb553c372153d6e9ba4934119623fdad3.tar.bz2
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/windows-tdep.c')
-rw-r--r--gdb/windows-tdep.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c
index 9049f1e..2516e4e 100644
--- a/gdb/windows-tdep.c
+++ b/gdb/windows-tdep.c
@@ -573,28 +573,21 @@ windows_xfer_shared_library (const char* so_name, CORE_ADDR load_addr,
static void
windows_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;
-
if (current_objfile)
{
- stop = cb (current_objfile, cb_data);
- if (stop)
+ if (cb (current_objfile))
return;
}
for (objfile *objfile : current_program_space->objfiles ())
- {
- if (objfile != current_objfile)
- {
- stop = cb (objfile, cb_data);
- if (stop)
- return;
- }
- }
+ if (objfile != current_objfile)
+ {
+ if (cb (objfile))
+ return;
+ }
}
static void