aboutsummaryrefslogtreecommitdiff
path: root/gdb/symfile-debug.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-03-30 08:41:17 -0600
committerTom Tromey <tom@tromey.com>2023-09-07 12:24:21 -0600
commitb7a92724c5bd926e094ede860049c1067f0584cf (patch)
tree10c7ff4050bc9e86896692ae4bf733f56ecd0316 /gdb/symfile-debug.c
parentdef2803789208a617c429b5dcf2026decb25ce0c (diff)
downloadbinutils-b7a92724c5bd926e094ede860049c1067f0584cf.zip
binutils-b7a92724c5bd926e094ede860049c1067f0584cf.tar.gz
binutils-b7a92724c5bd926e094ede860049c1067f0584cf.tar.bz2
Simplify block_find_symbol
block_find_symbol takes a callback function, but only two callbacks are ever passed to it -- and they are similar enough that it seems cleaner to just have block_find_symbol do the work itself. Also, block_find_symbol can take a lookup_name_info as an argument, following the general idea of pushing the construction of these objects as high in the call chain as feasible. Regression tested on x86-64 Fedora 38. Tested-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com>
Diffstat (limited to 'gdb/symfile-debug.c')
-rw-r--r--gdb/symfile-debug.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c
index 9db5c47..233cf33 100644
--- a/gdb/symfile-debug.c
+++ b/gdb/symfile-debug.c
@@ -260,23 +260,19 @@ objfile::lookup_symbol (block_enum kind, const char *name, domain_enum domain)
const struct blockvector *bv = stab->blockvector ();
const struct block *block = bv->block (kind);
- sym = block_find_symbol (block, name, domain,
- block_find_non_opaque_type_preferred,
- &with_opaque);
+ sym = block_find_symbol (block, lookup_name, domain, &with_opaque);
/* Some caution must be observed with overloaded functions
and methods, since the index will not contain any overload
information (but NAME might contain it). */
- if (sym != NULL
- && symbol_matches_search_name (sym, lookup_name))
+ if (sym != nullptr)
{
retval = stab;
/* Found it. */
return false;
}
- if (with_opaque != NULL
- && symbol_matches_search_name (with_opaque, lookup_name))
+ if (with_opaque != nullptr)
retval = stab;
/* Keep looking through other psymtabs. */