aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-exp.y
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ada-exp.y')
-rw-r--r--gdb/ada-exp.y22
1 files changed, 13 insertions, 9 deletions
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index 0126db5..cffeada 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -185,12 +185,12 @@ ada_pop (bool deprocedure_p = true, struct type *context_type = nullptr)
}
/* Like parser_state::wrap, but use ada_pop to pop the value. */
-template<typename T>
+template<typename T, typename... Args>
void
-ada_wrap ()
+ada_wrap (Args... args)
{
operation_up arg = ada_pop ();
- pstate->push_new<T> (std::move (arg));
+ pstate->push_new<T> (std::move (arg), std::forward<Args> (args)...);
}
/* Create and push an address-of operation, as appropriate for Ada.
@@ -519,7 +519,7 @@ make_tick_completer (struct stoken tok)
%right TICK_ACCESS TICK_ADDRESS TICK_FIRST TICK_LAST TICK_LENGTH
%right TICK_MAX TICK_MIN TICK_MODULUS
-%right TICK_POS TICK_RANGE TICK_SIZE TICK_TAG TICK_VAL
+%right TICK_POS TICK_RANGE TICK_SIZE TICK_OBJECT_SIZE TICK_TAG TICK_VAL
%right TICK_COMPLETE TICK_ENUM_REP TICK_ENUM_VAL
/* The following are right-associative only so that reductions at this
precedence have lower precedence than '.' and '('. The syntax still
@@ -914,7 +914,9 @@ primary : primary TICK_ACCESS
(std::move (arg), OP_ATR_LENGTH, $3);
}
| primary TICK_SIZE
- { ada_wrap<ada_atr_size_operation> (); }
+ { ada_wrap<ada_atr_size_operation> (true); }
+ | primary TICK_OBJECT_SIZE
+ { ada_wrap<ada_atr_size_operation> (false); }
| primary TICK_TAG
{ ada_wrap<ada_atr_tag_operation> (); }
| opt_type_prefix TICK_MIN '(' exp ',' exp ')'
@@ -1232,7 +1234,7 @@ primary : '*' primary %prec '.'
/* yylex defined in ada-lex.c: Reads one token, getting characters */
/* through lexptr. */
-/* Remap normal flex interface names (yylex) as well as gratuitiously */
+/* Remap normal flex interface names (yylex) as well as gratuitously */
/* global symbol names, so we can have multiple flex-generated parsers */
/* in gdb. */
@@ -1477,7 +1479,7 @@ block_lookup (const struct block *context, const char *raw_name)
if (context == NULL
&& (syms.empty () || syms[0].symbol->aclass () != LOC_BLOCK))
- symtab = lookup_symtab (name);
+ symtab = lookup_symtab (current_program_space, name);
else
symtab = NULL;
@@ -1831,7 +1833,7 @@ write_var_or_type (struct parser_state *par_state,
if (block != nullptr)
objfile = block->objfile ();
- struct bound_minimal_symbol msym
+ bound_minimal_symbol msym
= ada_lookup_simple_minsym (decoded_name.c_str (), objfile);
if (msym.minsym != NULL)
{
@@ -1857,7 +1859,9 @@ write_var_or_type (struct parser_state *par_state,
}
}
- if (!have_full_symbols () && !have_partial_symbols () && block == NULL)
+ if (!have_full_symbols (current_program_space)
+ && !have_partial_symbols (current_program_space)
+ && block == NULL)
error (_("No symbol table is loaded. Use the \"file\" command."));
if (block == par_state->expression_context_block)
error (_("No definition of \"%s\" in current context."), name0.ptr);