aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c229
1 files changed, 115 insertions, 114 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 409ecb1..9f9be64 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -108,14 +108,14 @@ static void ada_add_block_symbols (struct obstack *,
const struct block *, const char *,
domain_enum, struct objfile *, int);
-static int is_nonfunction (struct ada_symbol_info *, int);
+static int is_nonfunction (struct block_symbol *, int);
static void add_defn_to_vec (struct obstack *, struct symbol *,
const struct block *);
static int num_defns_collected (struct obstack *);
-static struct ada_symbol_info *defns_collected (struct obstack *, int);
+static struct block_symbol *defns_collected (struct obstack *, int);
static struct value *resolve_subexp (struct expression **, int *, int,
struct type *);
@@ -223,7 +223,7 @@ static int find_struct_field (const char *, struct type *, int,
static struct value *ada_to_fixed_value_create (struct type *, CORE_ADDR,
struct value *);
-static int ada_resolve_function (struct ada_symbol_info *, int,
+static int ada_resolve_function (struct block_symbol *, int,
struct value **, int, const char *,
struct type *);
@@ -3311,7 +3311,7 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
case OP_VAR_VALUE:
if (SYMBOL_DOMAIN (exp->elts[pc + 2].symbol) == UNDEF_DOMAIN)
{
- struct ada_symbol_info *candidates;
+ struct block_symbol *candidates;
int n_candidates;
n_candidates =
@@ -3327,7 +3327,7 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
out all types. */
int j;
for (j = 0; j < n_candidates; j += 1)
- switch (SYMBOL_CLASS (candidates[j].sym))
+ switch (SYMBOL_CLASS (candidates[j].symbol))
{
case LOC_REGISTER:
case LOC_ARG:
@@ -3345,7 +3345,7 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
j = 0;
while (j < n_candidates)
{
- if (SYMBOL_CLASS (candidates[j].sym) == LOC_TYPEDEF)
+ if (SYMBOL_CLASS (candidates[j].symbol) == LOC_TYPEDEF)
{
candidates[j] = candidates[n_candidates - 1];
n_candidates -= 1;
@@ -3381,7 +3381,7 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
}
exp->elts[pc + 1].block = candidates[i].block;
- exp->elts[pc + 2].symbol = candidates[i].sym;
+ exp->elts[pc + 2].symbol = candidates[i].symbol;
if (innermost_block == NULL
|| contained_in (candidates[i].block, innermost_block))
innermost_block = candidates[i].block;
@@ -3403,7 +3403,7 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
if (exp->elts[pc + 3].opcode == OP_VAR_VALUE
&& SYMBOL_DOMAIN (exp->elts[pc + 5].symbol) == UNDEF_DOMAIN)
{
- struct ada_symbol_info *candidates;
+ struct block_symbol *candidates;
int n_candidates;
n_candidates =
@@ -3426,7 +3426,7 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
}
exp->elts[pc + 4].block = candidates[i].block;
- exp->elts[pc + 5].symbol = candidates[i].sym;
+ exp->elts[pc + 5].symbol = candidates[i].symbol;
if (innermost_block == NULL
|| contained_in (candidates[i].block, innermost_block))
innermost_block = candidates[i].block;
@@ -3456,7 +3456,7 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
case UNOP_ABS:
if (possible_user_operator_p (op, argvec))
{
- struct ada_symbol_info *candidates;
+ struct block_symbol *candidates;
int n_candidates;
n_candidates =
@@ -3468,8 +3468,9 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
if (i < 0)
break;
- replace_operator_with_call (expp, pc, nargs, 1,
- candidates[i].sym, candidates[i].block);
+ replace_operator_with_call (expp, pc, nargs, 1,
+ candidates[i].symbol,
+ candidates[i].block);
exp = *expp;
}
break;
@@ -3623,7 +3624,7 @@ return_match (struct type *func_type, struct type *context_type)
the process; the index returned is for the modified vector. */
static int
-ada_resolve_function (struct ada_symbol_info syms[],
+ada_resolve_function (struct block_symbol syms[],
int nsyms, struct value **args, int nargs,
const char *name, struct type *context_type)
{
@@ -3639,9 +3640,9 @@ ada_resolve_function (struct ada_symbol_info syms[],
{
for (k = 0; k < nsyms; k += 1)
{
- struct type *type = ada_check_typedef (SYMBOL_TYPE (syms[k].sym));
+ struct type *type = ada_check_typedef (SYMBOL_TYPE (syms[k].symbol));
- if (ada_args_match (syms[k].sym, args, nargs)
+ if (ada_args_match (syms[k].symbol, args, nargs)
&& (fallback || return_match (type, context_type)))
{
syms[m] = syms[k];
@@ -3704,19 +3705,19 @@ encoded_ordered_before (const char *N0, const char *N1)
encoded names. */
static void
-sort_choices (struct ada_symbol_info syms[], int nsyms)
+sort_choices (struct block_symbol syms[], int nsyms)
{
int i;
for (i = 1; i < nsyms; i += 1)
{
- struct ada_symbol_info sym = syms[i];
+ struct block_symbol sym = syms[i];
int j;
for (j = i - 1; j >= 0; j -= 1)
{
- if (encoded_ordered_before (SYMBOL_LINKAGE_NAME (syms[j].sym),
- SYMBOL_LINKAGE_NAME (sym.sym)))
+ if (encoded_ordered_before (SYMBOL_LINKAGE_NAME (syms[j].symbol),
+ SYMBOL_LINKAGE_NAME (sym.symbol)))
break;
syms[j + 1] = syms[j];
}
@@ -3733,7 +3734,7 @@ sort_choices (struct ada_symbol_info syms[], int nsyms)
to be re-integrated one of these days. */
int
-user_select_syms (struct ada_symbol_info *syms, int nsyms, int max_results)
+user_select_syms (struct block_symbol *syms, int nsyms, int max_results)
{
int i;
int *chosen = (int *) alloca (sizeof (int) * nsyms);
@@ -3765,22 +3766,22 @@ See set/show multiple-symbol."));
for (i = 0; i < nsyms; i += 1)
{
- if (syms[i].sym == NULL)
+ if (syms[i].symbol == NULL)
continue;
- if (SYMBOL_CLASS (syms[i].sym) == LOC_BLOCK)
+ if (SYMBOL_CLASS (syms[i].symbol) == LOC_BLOCK)
{
struct symtab_and_line sal =
- find_function_start_sal (syms[i].sym, 1);
+ find_function_start_sal (syms[i].symbol, 1);
if (sal.symtab == NULL)
printf_unfiltered (_("[%d] %s at <no source file available>:%d\n"),
i + first_choice,
- SYMBOL_PRINT_NAME (syms[i].sym),
+ SYMBOL_PRINT_NAME (syms[i].symbol),
sal.line);
else
printf_unfiltered (_("[%d] %s at %s:%d\n"), i + first_choice,
- SYMBOL_PRINT_NAME (syms[i].sym),
+ SYMBOL_PRINT_NAME (syms[i].symbol),
symtab_to_filename_for_display (sal.symtab),
sal.line);
continue;
@@ -3788,42 +3789,42 @@ See set/show multiple-symbol."));
else
{
int is_enumeral =
- (SYMBOL_CLASS (syms[i].sym) == LOC_CONST
- && SYMBOL_TYPE (syms[i].sym) != NULL
- && TYPE_CODE (SYMBOL_TYPE (syms[i].sym)) == TYPE_CODE_ENUM);
+ (SYMBOL_CLASS (syms[i].symbol) == LOC_CONST
+ && SYMBOL_TYPE (syms[i].symbol) != NULL
+ && TYPE_CODE (SYMBOL_TYPE (syms[i].symbol)) == TYPE_CODE_ENUM);
struct symtab *symtab = NULL;
- if (SYMBOL_OBJFILE_OWNED (syms[i].sym))
- symtab = symbol_symtab (syms[i].sym);
+ if (SYMBOL_OBJFILE_OWNED (syms[i].symbol))
+ symtab = symbol_symtab (syms[i].symbol);
- if (SYMBOL_LINE (syms[i].sym) != 0 && symtab != NULL)
+ if (SYMBOL_LINE (syms[i].symbol) != 0 && symtab != NULL)
printf_unfiltered (_("[%d] %s at %s:%d\n"),
i + first_choice,
- SYMBOL_PRINT_NAME (syms[i].sym),
+ SYMBOL_PRINT_NAME (syms[i].symbol),
symtab_to_filename_for_display (symtab),
- SYMBOL_LINE (syms[i].sym));
+ SYMBOL_LINE (syms[i].symbol));
else if (is_enumeral
- && TYPE_NAME (SYMBOL_TYPE (syms[i].sym)) != NULL)
+ && TYPE_NAME (SYMBOL_TYPE (syms[i].symbol)) != NULL)
{
printf_unfiltered (("[%d] "), i + first_choice);
- ada_print_type (SYMBOL_TYPE (syms[i].sym), NULL,
+ ada_print_type (SYMBOL_TYPE (syms[i].symbol), NULL,
gdb_stdout, -1, 0, &type_print_raw_options);
printf_unfiltered (_("'(%s) (enumeral)\n"),
- SYMBOL_PRINT_NAME (syms[i].sym));
+ SYMBOL_PRINT_NAME (syms[i].symbol));
}
else if (symtab != NULL)
printf_unfiltered (is_enumeral
? _("[%d] %s in %s (enumeral)\n")
: _("[%d] %s at %s:?\n"),
i + first_choice,
- SYMBOL_PRINT_NAME (syms[i].sym),
+ SYMBOL_PRINT_NAME (syms[i].symbol),
symtab_to_filename_for_display (symtab));
else
printf_unfiltered (is_enumeral
? _("[%d] %s (enumeral)\n")
: _("[%d] %s at ?\n"),
i + first_choice,
- SYMBOL_PRINT_NAME (syms[i].sym));
+ SYMBOL_PRINT_NAME (syms[i].symbol));
}
}
@@ -4603,13 +4604,13 @@ standard_lookup (const char *name, const struct block *block,
domain_enum domain)
{
/* Initialize it just to avoid a GCC false warning. */
- struct symbol *sym = NULL;
+ struct block_symbol sym = {NULL, NULL};
- if (lookup_cached_symbol (name, domain, &sym, NULL))
- return sym;
+ if (lookup_cached_symbol (name, domain, &sym.symbol, NULL))
+ return sym.symbol;
sym = lookup_symbol_in_language (name, block, domain, language_c, 0);
- cache_symbol (name, domain, sym, block_found);
- return sym;
+ cache_symbol (name, domain, sym.symbol, sym.block);
+ return sym.symbol;
}
@@ -4617,14 +4618,14 @@ standard_lookup (const char *name, const struct block *block,
in the symbol fields of SYMS[0..N-1]. We treat enumerals as functions,
since they contend in overloading in the same way. */
static int
-is_nonfunction (struct ada_symbol_info syms[], int n)
+is_nonfunction (struct block_symbol syms[], int n)
{
int i;
for (i = 0; i < n; i += 1)
- if (TYPE_CODE (SYMBOL_TYPE (syms[i].sym)) != TYPE_CODE_FUNC
- && (TYPE_CODE (SYMBOL_TYPE (syms[i].sym)) != TYPE_CODE_ENUM
- || SYMBOL_CLASS (syms[i].sym) != LOC_CONST))
+ if (TYPE_CODE (SYMBOL_TYPE (syms[i].symbol)) != TYPE_CODE_FUNC
+ && (TYPE_CODE (SYMBOL_TYPE (syms[i].symbol)) != TYPE_CODE_ENUM
+ || SYMBOL_CLASS (syms[i].symbol) != LOC_CONST))
return 1;
return 0;
@@ -4688,7 +4689,7 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1)
}
}
-/* Append (SYM,BLOCK,SYMTAB) to the end of the array of struct ada_symbol_info
+/* Append (SYM,BLOCK,SYMTAB) to the end of the array of struct block_symbol
records in OBSTACKP. Do nothing if SYM is a duplicate. */
static void
@@ -4697,7 +4698,7 @@ add_defn_to_vec (struct obstack *obstackp,
const struct block *block)
{
int i;
- struct ada_symbol_info *prevDefns = defns_collected (obstackp, 0);
+ struct block_symbol *prevDefns = defns_collected (obstackp, 0);
/* Do not try to complete stub types, as the debugger is probably
already scanning all symbols matching a certain name at the
@@ -4710,45 +4711,44 @@ add_defn_to_vec (struct obstack *obstackp,
for (i = num_defns_collected (obstackp) - 1; i >= 0; i -= 1)
{
- if (lesseq_defined_than (sym, prevDefns[i].sym))
+ if (lesseq_defined_than (sym, prevDefns[i].symbol))
return;
- else if (lesseq_defined_than (prevDefns[i].sym, sym))
+ else if (lesseq_defined_than (prevDefns[i].symbol, sym))
{
- prevDefns[i].sym = sym;
+ prevDefns[i].symbol = sym;
prevDefns[i].block = block;
return;
}
}
{
- struct ada_symbol_info info;
+ struct block_symbol info;
- info.sym = sym;
+ info.symbol = sym;
info.block = block;
- obstack_grow (obstackp, &info, sizeof (struct ada_symbol_info));
+ obstack_grow (obstackp, &info, sizeof (struct block_symbol));
}
}
-/* Number of ada_symbol_info structures currently collected in
- current vector in *OBSTACKP. */
+/* Number of block_symbol structures currently collected in current vector in
+ OBSTACKP. */
static int
num_defns_collected (struct obstack *obstackp)
{
- return obstack_object_size (obstackp) / sizeof (struct ada_symbol_info);
+ return obstack_object_size (obstackp) / sizeof (struct block_symbol);
}
-/* Vector of ada_symbol_info structures currently collected in current
- vector in *OBSTACKP. If FINISH, close off the vector and return
- its final address. */
+/* Vector of block_symbol structures currently collected in current vector in
+ OBSTACKP. If FINISH, close off the vector and return its final address. */
-static struct ada_symbol_info *
+static struct block_symbol *
defns_collected (struct obstack *obstackp, int finish)
{
if (finish)
return obstack_finish (obstackp);
else
- return (struct ada_symbol_info *) obstack_base (obstackp);
+ return (struct block_symbol *) obstack_base (obstackp);
}
/* Return a bound minimal symbol matching NAME according to Ada
@@ -4879,7 +4879,7 @@ ada_identical_enum_types_p (struct type *type1, struct type *type2)
So, for practical purposes, we consider them as the same. */
static int
-symbols_are_identical_enums (struct ada_symbol_info *syms, int nsyms)
+symbols_are_identical_enums (struct block_symbol *syms, int nsyms)
{
int i;
@@ -4892,26 +4892,26 @@ symbols_are_identical_enums (struct ada_symbol_info *syms, int nsyms)
/* Quick check: All symbols should have an enum type. */
for (i = 0; i < nsyms; i++)
- if (TYPE_CODE (SYMBOL_TYPE (syms[i].sym)) != TYPE_CODE_ENUM)
+ if (TYPE_CODE (SYMBOL_TYPE (syms[i].symbol)) != TYPE_CODE_ENUM)
return 0;
/* Quick check: They should all have the same value. */
for (i = 1; i < nsyms; i++)
- if (SYMBOL_VALUE (syms[i].sym) != SYMBOL_VALUE (syms[0].sym))
+ if (SYMBOL_VALUE (syms[i].symbol) != SYMBOL_VALUE (syms[0].symbol))
return 0;
/* Quick check: They should all have the same number of enumerals. */
for (i = 1; i < nsyms; i++)
- if (TYPE_NFIELDS (SYMBOL_TYPE (syms[i].sym))
- != TYPE_NFIELDS (SYMBOL_TYPE (syms[0].sym)))
+ if (TYPE_NFIELDS (SYMBOL_TYPE (syms[i].symbol))
+ != TYPE_NFIELDS (SYMBOL_TYPE (syms[0].symbol)))
return 0;
/* All the sanity checks passed, so we might have a set of
identical enumeration types. Perform a more complete
comparison of the type of each symbol. */
for (i = 1; i < nsyms; i++)
- if (!ada_identical_enum_types_p (SYMBOL_TYPE (syms[i].sym),
- SYMBOL_TYPE (syms[0].sym)))
+ if (!ada_identical_enum_types_p (SYMBOL_TYPE (syms[i].symbol),
+ SYMBOL_TYPE (syms[0].symbol)))
return 0;
return 1;
@@ -4925,7 +4925,7 @@ symbols_are_identical_enums (struct ada_symbol_info *syms, int nsyms)
Returns the number of items in the modified list. */
static int
-remove_extra_symbols (struct ada_symbol_info *syms, int nsyms)
+remove_extra_symbols (struct block_symbol *syms, int nsyms)
{
int i, j;
@@ -4943,16 +4943,16 @@ remove_extra_symbols (struct ada_symbol_info *syms, int nsyms)
/* If two symbols have the same name and one of them is a stub type,
the get rid of the stub. */
- if (TYPE_STUB (SYMBOL_TYPE (syms[i].sym))
- && SYMBOL_LINKAGE_NAME (syms[i].sym) != NULL)
+ if (TYPE_STUB (SYMBOL_TYPE (syms[i].symbol))
+ && SYMBOL_LINKAGE_NAME (syms[i].symbol) != NULL)
{
for (j = 0; j < nsyms; j++)
{
if (j != i
- && !TYPE_STUB (SYMBOL_TYPE (syms[j].sym))
- && SYMBOL_LINKAGE_NAME (syms[j].sym) != NULL
- && strcmp (SYMBOL_LINKAGE_NAME (syms[i].sym),
- SYMBOL_LINKAGE_NAME (syms[j].sym)) == 0)
+ && !TYPE_STUB (SYMBOL_TYPE (syms[j].symbol))
+ && SYMBOL_LINKAGE_NAME (syms[j].symbol) != NULL
+ && strcmp (SYMBOL_LINKAGE_NAME (syms[i].symbol),
+ SYMBOL_LINKAGE_NAME (syms[j].symbol)) == 0)
remove_p = 1;
}
}
@@ -4960,19 +4960,20 @@ remove_extra_symbols (struct ada_symbol_info *syms, int nsyms)
/* Two symbols with the same name, same class and same address
should be identical. */
- else if (SYMBOL_LINKAGE_NAME (syms[i].sym) != NULL
- && SYMBOL_CLASS (syms[i].sym) == LOC_STATIC
- && is_nondebugging_type (SYMBOL_TYPE (syms[i].sym)))
+ else if (SYMBOL_LINKAGE_NAME (syms[i].symbol) != NULL
+ && SYMBOL_CLASS (syms[i].symbol) == LOC_STATIC
+ && is_nondebugging_type (SYMBOL_TYPE (syms[i].symbol)))
{
for (j = 0; j < nsyms; j += 1)
{
if (i != j
- && SYMBOL_LINKAGE_NAME (syms[j].sym) != NULL
- && strcmp (SYMBOL_LINKAGE_NAME (syms[i].sym),
- SYMBOL_LINKAGE_NAME (syms[j].sym)) == 0
- && SYMBOL_CLASS (syms[i].sym) == SYMBOL_CLASS (syms[j].sym)
- && SYMBOL_VALUE_ADDRESS (syms[i].sym)
- == SYMBOL_VALUE_ADDRESS (syms[j].sym))
+ && SYMBOL_LINKAGE_NAME (syms[j].symbol) != NULL
+ && strcmp (SYMBOL_LINKAGE_NAME (syms[i].symbol),
+ SYMBOL_LINKAGE_NAME (syms[j].symbol)) == 0
+ && SYMBOL_CLASS (syms[i].symbol)
+ == SYMBOL_CLASS (syms[j].symbol)
+ && SYMBOL_VALUE_ADDRESS (syms[i].symbol)
+ == SYMBOL_VALUE_ADDRESS (syms[j].symbol))
remove_p = 1;
}
}
@@ -5151,7 +5152,7 @@ old_renaming_is_invisible (const struct symbol *sym, const char *function_name)
the user will be unable to print such rename entities. */
static int
-remove_irrelevant_renamings (struct ada_symbol_info *syms,
+remove_irrelevant_renamings (struct block_symbol *syms,
int nsyms, const struct block *current_block)
{
struct symbol *current_function;
@@ -5165,7 +5166,7 @@ remove_irrelevant_renamings (struct ada_symbol_info *syms,
is_new_style_renaming = 0;
for (i = 0; i < nsyms; i += 1)
{
- struct symbol *sym = syms[i].sym;
+ struct symbol *sym = syms[i].symbol;
const struct block *block = syms[i].block;
const char *name;
const char *suffix;
@@ -5182,11 +5183,11 @@ remove_irrelevant_renamings (struct ada_symbol_info *syms,
is_new_style_renaming = 1;
for (j = 0; j < nsyms; j += 1)
- if (i != j && syms[j].sym != NULL
- && strncmp (name, SYMBOL_LINKAGE_NAME (syms[j].sym),
+ if (i != j && syms[j].symbol != NULL
+ && strncmp (name, SYMBOL_LINKAGE_NAME (syms[j].symbol),
name_len) == 0
&& block == syms[j].block)
- syms[j].sym = NULL;
+ syms[j].symbol = NULL;
}
}
if (is_new_style_renaming)
@@ -5194,7 +5195,7 @@ remove_irrelevant_renamings (struct ada_symbol_info *syms,
int j, k;
for (j = k = 0; j < nsyms; j += 1)
- if (syms[j].sym != NULL)
+ if (syms[j].symbol != NULL)
{
syms[k] = syms[j];
k += 1;
@@ -5223,9 +5224,9 @@ remove_irrelevant_renamings (struct ada_symbol_info *syms,
i = 0;
while (i < nsyms)
{
- if (ada_parse_renaming (syms[i].sym, NULL, NULL, NULL)
+ if (ada_parse_renaming (syms[i].symbol, NULL, NULL, NULL)
== ADA_OBJECT_RENAMING
- && old_renaming_is_invisible (syms[i].sym, current_function_name))
+ && old_renaming_is_invisible (syms[i].symbol, current_function_name))
{
int j;
@@ -5479,7 +5480,7 @@ add_nonlocal_symbols (struct obstack *obstackp, const char *name,
static int
ada_lookup_symbol_list_worker (const char *name0, const struct block *block0,
domain_enum domain,
- struct ada_symbol_info **results,
+ struct block_symbol **results,
int full_search)
{
struct symbol *sym;
@@ -5566,7 +5567,7 @@ done:
cache_symbol (name0, domain, NULL, NULL);
if (ndefns == 1 && full_search && syms_from_global_search)
- cache_symbol (name0, domain, (*results)[0].sym, (*results)[0].block);
+ cache_symbol (name0, domain, (*results)[0].symbol, (*results)[0].block);
ndefns = remove_irrelevant_renamings (*results, ndefns, block0);
@@ -5580,7 +5581,7 @@ done:
int
ada_lookup_symbol_list (const char *name0, const struct block *block0,
- domain_enum domain, struct ada_symbol_info **results)
+ domain_enum domain, struct block_symbol **results)
{
return ada_lookup_symbol_list_worker (name0, block0, domain, results, 1);
}
@@ -5594,12 +5595,12 @@ ada_iterate_over_symbols (const struct block *block,
void *data)
{
int ndefs, i;
- struct ada_symbol_info *results;
+ struct block_symbol *results;
ndefs = ada_lookup_symbol_list_worker (name, block, domain, &results, 0);
for (i = 0; i < ndefs; ++i)
{
- if (! (*callback) (results[i].sym, data))
+ if (! (*callback) (results[i].symbol, data))
break;
}
}
@@ -5639,20 +5640,20 @@ ada_name_for_lookup (const char *name)
void
ada_lookup_encoded_symbol (const char *name, const struct block *block,
domain_enum domain,
- struct ada_symbol_info *info)
+ struct block_symbol *info)
{
- struct ada_symbol_info *candidates;
+ struct block_symbol *candidates;
int n_candidates;
gdb_assert (info != NULL);
- memset (info, 0, sizeof (struct ada_symbol_info));
+ memset (info, 0, sizeof (struct block_symbol));
n_candidates = ada_lookup_symbol_list (name, block, domain, &candidates);
if (n_candidates == 0)
return;
*info = candidates[0];
- info->sym = fixup_symbol_section (info->sym, NULL);
+ info->symbol = fixup_symbol_section (info->symbol, NULL);
}
/* Return a symbol in DOMAIN matching NAME, in BLOCK0 and enclosing
@@ -5661,30 +5662,30 @@ ada_lookup_encoded_symbol (const char *name, const struct block *block,
choosing the first symbol if there are multiple choices.
If IS_A_FIELD_OF_THIS is not NULL, it is set to zero. */
-struct symbol *
+struct block_symbol
ada_lookup_symbol (const char *name, const struct block *block0,
domain_enum domain, int *is_a_field_of_this)
{
- struct ada_symbol_info info;
+ struct block_symbol info;
if (is_a_field_of_this != NULL)
*is_a_field_of_this = 0;
ada_lookup_encoded_symbol (ada_encode (ada_fold_name (name)),
block0, domain, &info);
- return info.sym;
+ return info;
}
-static struct symbol *
+static struct block_symbol
ada_lookup_symbol_nonlocal (const struct language_defn *langdef,
const char *name,
const struct block *block,
const domain_enum domain)
{
- struct symbol *sym;
+ struct block_symbol sym;
sym = ada_lookup_symbol (name, block_static_block (block), domain, NULL);
- if (sym != NULL)
+ if (sym.symbol != NULL)
return sym;
/* If we haven't found a match at this point, try the primitive
@@ -5707,12 +5708,12 @@ ada_lookup_symbol_nonlocal (const struct language_defn *langdef,
gdbarch = target_gdbarch ();
else
gdbarch = block_gdbarch (block);
- sym = language_lookup_primitive_type_as_symbol (langdef, gdbarch, name);
- if (sym != NULL)
+ sym.symbol = language_lookup_primitive_type_as_symbol (langdef, gdbarch, name);
+ if (sym.symbol != NULL)
return sym;
}
- return NULL;
+ return (struct block_symbol) {NULL, NULL};
}
@@ -11372,7 +11373,7 @@ scan_discrim_bound (char *str, int k, struct value *dval, LONGEST * px,
static struct value *
get_var_value (char *name, char *err_msg)
{
- struct ada_symbol_info *syms;
+ struct block_symbol *syms;
int nsyms;
nsyms = ada_lookup_symbol_list (name, get_selected_block (0), VAR_DOMAIN,
@@ -11386,7 +11387,7 @@ get_var_value (char *name, char *err_msg)
error (("%s"), err_msg);
}
- return value_of_variable (syms[0].sym, syms[0].block);
+ return value_of_variable (syms[0].symbol, syms[0].block);
}
/* Value of integer variable named NAME in the current environment. If