diff options
author | Tom Tromey <tom@tromey.com> | 2023-03-19 16:12:58 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-03-28 15:12:40 -0600 |
commit | 6b3a2759052d1874a5952b7901e2b41890ae992f (patch) | |
tree | 01f270a3fab39bb9c5ed71c12b9cc26667e60b75 /gdb/solib-frv.c | |
parent | a0719e0a0552679ac51aafaf2f6b30cfecf20ed3 (diff) | |
download | fsf-binutils-gdb-6b3a2759052d1874a5952b7901e2b41890ae992f.zip fsf-binutils-gdb-6b3a2759052d1874a5952b7901e2b41890ae992f.tar.gz fsf-binutils-gdb-6b3a2759052d1874a5952b7901e2b41890ae992f.tar.bz2 |
Use function_view in gdb_bfd_lookup_symbol
This changes gdb_bfd_lookup_symbol to use a function_view. This
simplifies the code a little bit.
Diffstat (limited to 'gdb/solib-frv.c')
-rw-r--r-- | gdb/solib-frv.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c index 38aed7a..240b4da 100644 --- a/gdb/solib-frv.c +++ b/gdb/solib-frv.c @@ -472,14 +472,6 @@ enable_break_failure_warning (void) "and track explicitly loaded dynamic code.")); } -/* Helper function for gdb_bfd_lookup_symbol. */ - -static int -cmp_name (const asymbol *sym, const void *data) -{ - return (strcmp (sym->name, (const char *) data) == 0); -} - /* Arrange for dynamic linker to hit breakpoint. The dynamic linkers has, as part of its debugger interface, support @@ -602,7 +594,12 @@ enable_break2 (void) interp_plt_sect_low + bfd_section_size (interp_sect); } - addr = gdb_bfd_lookup_symbol (tmp_bfd.get (), cmp_name, "_dl_debug_addr"); + addr = (gdb_bfd_lookup_symbol + (tmp_bfd.get (), + [] (const asymbol *sym) + { + return strcmp (sym->name, "_dl_debug_addr") == 0; + })); if (addr == 0) { |