aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-03-14 16:56:38 -0600
committerTom Tromey <tom@tromey.com>2023-08-31 12:41:02 -0600
commit911e1e795e2496e1a5315601ab89e56afcd10fb0 (patch)
tree6238e7783a5cf642c10652b3651c85768781c22a /gdb/symtab.c
parent8c329d5c651e671f9aa9ed87224dc9943a7f76e6 (diff)
downloadgdb-911e1e795e2496e1a5315601ab89e56afcd10fb0.zip
gdb-911e1e795e2496e1a5315601ab89e56afcd10fb0.tar.gz
gdb-911e1e795e2496e1a5315601ab89e56afcd10fb0.tar.bz2
Add symbol::matches method
This adds symbol::matches, a wrapper for symbol_matches_domain. Most places calling symbol_matches_domain can call this method instead, which is a bit less wordy and also (IMO) clearer. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 838d711..d8ce2bf 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -2288,8 +2288,7 @@ lookup_symbol_in_objfile_symtabs (struct objfile *objfile,
other = result;
break;
}
- if (symbol_matches_domain (result.symbol->language (),
- result.symbol->domain (), domain))
+ if (result.symbol->matches (domain))
{
struct symbol *better
= better_symbol (other.symbol, result.symbol, domain);
@@ -2777,7 +2776,7 @@ iterate_over_symbols (const struct block *block,
{
for (struct symbol *sym : block_iterator_range (block, &name))
{
- if (symbol_matches_domain (sym->language (), sym->domain (), domain))
+ if (sym->matches (domain))
{
struct block_symbol block_sym = {sym, block};