aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-exp.y
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2024-06-03 12:52:54 -0600
committerTom Tromey <tromey@adacore.com>2024-06-14 11:18:22 -0600
commit3739147957a5bb37352033bec9ca21b88f98c7e9 (patch)
tree175f0a8c581586b272ffd1ab2741e7bd34b791e2 /gdb/ada-exp.y
parent9c23c0df0dc47560bf3e253186e0192bc9630c80 (diff)
downloadgdb-3739147957a5bb37352033bec9ca21b88f98c7e9.zip
gdb-3739147957a5bb37352033bec9ca21b88f98c7e9.tar.gz
gdb-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-exp.y')
-rw-r--r--gdb/ada-exp.y10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index f3cef6d..c2ab1de 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -1322,7 +1322,6 @@ write_object_renaming (struct parser_state *par_state,
{
char *name;
enum { SIMPLE_INDEX, LOWER_BOUND, UPPER_BOUND } slice_state;
- struct block_symbol sym_info;
if (max_depth <= 0)
error (_("Could not find renamed symbol"));
@@ -1332,7 +1331,8 @@ write_object_renaming (struct parser_state *par_state,
name = obstack_strndup (&ada_parser->temp_space, renamed_entity,
renamed_entity_len);
- ada_lookup_encoded_symbol (name, orig_left_context, SEARCH_VFT, &sym_info);
+ block_symbol sym_info = ada_lookup_encoded_symbol (name, orig_left_context,
+ SEARCH_VFT);
if (sym_info.symbol == NULL)
error (_("Could not find renamed variable: %s"), ada_decode (name).c_str ());
else if (sym_info.symbol->aclass () == LOC_TYPEDEF)
@@ -1390,7 +1390,6 @@ write_object_renaming (struct parser_state *par_state,
{
const char *end;
char *index_name;
- struct block_symbol index_sym_info;
end = strchr (renaming_expr, 'X');
if (end == NULL)
@@ -1401,8 +1400,9 @@ write_object_renaming (struct parser_state *par_state,
end - renaming_expr);
renaming_expr = end;
- ada_lookup_encoded_symbol (index_name, orig_left_context,
- SEARCH_VFT, &index_sym_info);
+ block_symbol index_sym_info
+ = ada_lookup_encoded_symbol (index_name, orig_left_context,
+ SEARCH_VFT);
if (index_sym_info.symbol == NULL)
error (_("Could not find %s"), index_name);
else if (index_sym_info.symbol->aclass () == LOC_TYPEDEF)