diff options
author | Tom Tromey <tromey@adacore.com> | 2024-06-03 12:52:54 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2024-06-14 11:18:22 -0600 |
commit | 3739147957a5bb37352033bec9ca21b88f98c7e9 (patch) | |
tree | 175f0a8c581586b272ffd1ab2741e7bd34b791e2 /gdb/ada-lang.c | |
parent | 9c23c0df0dc47560bf3e253186e0192bc9630c80 (diff) | |
download | binutils-3739147957a5bb37352033bec9ca21b88f98c7e9.zip binutils-3739147957a5bb37352033bec9ca21b88f98c7e9.tar.gz binutils-3739147957a5bb37352033bec9ca21b88f98c7e9.tar.bz2 |
Simplify ada_lookup_encoded_symbol
This patch simplifies ada_lookup_encoded_symbol by having it return
its result, rather than returning void and having an out parameter.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r-- | gdb/ada-lang.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 01978e0..46c2057 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -4792,7 +4792,7 @@ standard_lookup (const char *name, const struct block *block, if (lookup_cached_symbol (name, domain, &sym.symbol, NULL)) return sym.symbol; - ada_lookup_encoded_symbol (name, block, domain, &sym); + sym = ada_lookup_encoded_symbol (name, block, domain); cache_symbol (name, domain, sym.symbol, sym.block); return sym.symbol; } @@ -5703,15 +5703,11 @@ ada_lookup_symbol_list (const char *name, const struct block *block, /* The result is as for ada_lookup_symbol_list with FULL_SEARCH set to 1, but choosing the first symbol found if there are multiple - choices. + choices. */ - The result is stored in *INFO, which must be non-NULL. - If no match is found, INFO->SYM is set to NULL. */ - -void +block_symbol ada_lookup_encoded_symbol (const char *name, const struct block *block, - domain_search_flags domain, - struct block_symbol *info) + domain_search_flags domain) { /* Since we already have an encoded name, wrap it in '<>' to force a verbatim match. Otherwise, if the name happens to not look like @@ -5720,9 +5716,7 @@ ada_lookup_encoded_symbol (const char *name, const struct block *block, would e.g., incorrectly lowercase object renaming names like "R28b" -> "r28b". */ std::string verbatim = add_angle_brackets (name); - - gdb_assert (info != NULL); - *info = ada_lookup_symbol (verbatim.c_str (), block, domain); + return ada_lookup_symbol (verbatim.c_str (), block, domain); } /* Return a symbol in DOMAIN matching NAME, in BLOCK0 and enclosing |