#include "valprint.h"
#include "source.h"
#include "observable.h"
-#include "common/vec.h"
+#include "gdbsupport/vec.h"
#include "stack.h"
-#include "common/gdb_vecs.h"
+#include "gdbsupport/gdb_vecs.h"
#include "typeprint.h"
#include "namespace.h"
#include "mi/mi-common.h"
#include "arch-utils.h"
#include "cli/cli-utils.h"
-#include "common/function-view.h"
-#include "common/byte-vector.h"
+#include "gdbsupport/function-view.h"
+#include "gdbsupport/byte-vector.h"
#include <algorithm>
#include <map>
enum language
ada_update_initial_language (enum language lang)
{
- if (lookup_minimal_symbol ("adainit", (const char *) NULL,
- (struct objfile *) NULL).minsym != NULL)
+ if (lookup_minimal_symbol ("adainit", NULL, NULL).minsym != NULL)
return language_ada;
return lang;
std::string verbatim = std::string ("<") + name + '>';
gdb_assert (info != NULL);
- *info = ada_lookup_symbol (verbatim.c_str (), block, domain, NULL);
+ *info = ada_lookup_symbol (verbatim.c_str (), block, domain);
}
/* Return a symbol in DOMAIN matching NAME, in BLOCK0 and enclosing
scope and in global scopes, or NULL if none. NAME is folded and
encoded first. Otherwise, the result is as for ada_lookup_symbol_list,
- choosing the first symbol if there are multiple choices.
- If IS_A_FIELD_OF_THIS is not NULL, it is set to zero. */
+ choosing the first symbol if there are multiple choices. */
struct block_symbol
ada_lookup_symbol (const char *name, const struct block *block0,
- domain_enum domain, int *is_a_field_of_this)
+ domain_enum domain)
{
- if (is_a_field_of_this != NULL)
- *is_a_field_of_this = 0;
-
std::vector<struct block_symbol> candidates;
int n_candidates;
{
struct block_symbol sym;
- sym = ada_lookup_symbol (name, block_static_block (block), domain, NULL);
+ sym = ada_lookup_symbol (name, block_static_block (block), domain);
if (sym.symbol != NULL)
return sym;
if (noside == EVAL_SKIP)
goto nosideret;
+ else if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ {
+ if (type_arg == NULL)
+ type_arg = value_type (arg1);
+
+ if (ada_is_constrained_packed_array_type (type_arg))
+ type_arg = decode_constrained_packed_array_type (type_arg);
+
+ if (!discrete_type_p (type_arg))
+ {
+ switch (op)
+ {
+ default: /* Should never happen. */
+ error (_("unexpected attribute encountered"));
+ case OP_ATR_FIRST:
+ case OP_ATR_LAST:
+ type_arg = ada_index_type (type_arg, tem,
+ ada_attribute_name (op));
+ break;
+ case OP_ATR_LENGTH:
+ type_arg = builtin_type (exp->gdbarch)->builtin_int;
+ break;
+ }
+ }
- if (type_arg == NULL)
+ return value_zero (type_arg, not_lval);
+ }
+ else if (type_arg == NULL)
{
arg1 = ada_coerce_ref (arg1);
type = builtin_type (exp->gdbarch)->builtin_int;
}
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return allocate_value (type);
-
switch (op)
{
default: /* Should never happen. */
type = builtin_type (exp->gdbarch)->builtin_int;
}
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return allocate_value (type);
-
switch (op)
{
default: