diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2022-05-04 08:14:22 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2022-05-05 15:27:26 -0400 |
commit | 6e9cd73eb553c372153d6e9ba4934119623fdad3 (patch) | |
tree | 1eb62a3689f410c6554d8d94bff6502d1a9a6849 /gdb/solib-svr4.c | |
parent | 1653ae5b8440e2182ac86974b99b603bc15aa163 (diff) | |
download | gdb-6e9cd73eb553c372153d6e9ba4934119623fdad3.zip gdb-6e9cd73eb553c372153d6e9ba4934119623fdad3.tar.gz 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/solib-svr4.c')
-rw-r--r-- | gdb/solib-svr4.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 2f3e79d..5c046d3 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -51,9 +51,9 @@ static int svr4_have_link_map_offsets (void); static void svr4_relocate_main_executable (void); static void svr4_free_library_list (void *p_list); static void probes_table_remove_objfile_probes (struct objfile *objfile); -static void svr4_iterate_over_objfiles_in_search_order ( - struct gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype *cb, - void *cb_data, struct objfile *objfile); +static void svr4_iterate_over_objfiles_in_search_order + (gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype cb, + objfile *current_objfile); /* On SVR4 systems, a list of symbols in the dynamic linker where @@ -3135,9 +3135,8 @@ struct target_so_ops svr4_so_ops; static void svr4_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) { bool checked_current_objfile = false; if (current_objfile != nullptr) @@ -3156,7 +3155,7 @@ svr4_iterate_over_objfiles_in_search_order && gdb_bfd_scan_elf_dyntag (DT_SYMBOLIC, abfd, nullptr, nullptr) == 1) { checked_current_objfile = true; - if (cb (current_objfile, cb_data) != 0) + if (cb (current_objfile)) return; } } @@ -3165,7 +3164,7 @@ svr4_iterate_over_objfiles_in_search_order { if (checked_current_objfile && objfile == current_objfile) continue; - if (cb (objfile, cb_data) != 0) + if (cb (objfile)) return; } } |