aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-exp.y
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-03-24 11:20:05 -0600
committerTom Tromey <tom@tromey.com>2019-04-04 19:55:10 -0600
commit1e58a4a4db997cf09315c22f3da725d1da7f9ee7 (patch)
tree5166626dc2cad5a02581b158edaa245045922ab9 /gdb/ada-exp.y
parent37eedb39824dc26c82a92b5515a352d7de0c9b5b (diff)
downloadgdb-1e58a4a4db997cf09315c22f3da725d1da7f9ee7.zip
gdb-1e58a4a4db997cf09315c22f3da725d1da7f9ee7.tar.gz
gdb-1e58a4a4db997cf09315c22f3da725d1da7f9ee7.tar.bz2
Move expression_context_* globals to parser_state
This moves the expression_context_block and expression_context_pc globals to be members of parser_state and updates the parsers. gdb/ChangeLog 2019-04-04 Tom Tromey <tom@tromey.com> * rust-exp.y (rust_parser::crate_name, rust_parser::super_name) (rust_parser::convert_ast_to_type) (rust_parser::convert_ast_to_expression, rust_lex_tests): Update. * parser-defs.h (struct parser_state) <parser_state>: Add parameters. Initialize new members. <expression_context_block, expression_context_pc>: New members. * parse.c (expression_context_block, expression_context_pc): Remove globals. (parse_exp_in_context): Update. * p-exp.y: Update all rules. (yylex): Update. * m2-exp.y: Update all rules. (yylex): Update. * go-exp.y (yylex): Update. * f-exp.y (yylex): Update. * d-exp.y: Update all rules. (yylex): Update. * c-exp.y: Update all rules. (lex_one_token, classify_name, yylex, c_parse): Update. * ada-exp.y (write_var_or_type, write_name_assoc): Update.
Diffstat (limited to 'gdb/ada-exp.y')
-rw-r--r--gdb/ada-exp.y7
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index f1c587a..0cf85c5 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -1203,7 +1203,7 @@ write_var_or_type (struct parser_state *par_state,
int name_len;
if (block == NULL)
- block = expression_context_block;
+ block = par_state->expression_context_block;
encoded_name = ada_encode (name0.ptr);
name_len = strlen (encoded_name);
@@ -1343,7 +1343,7 @@ write_var_or_type (struct parser_state *par_state,
if (!have_full_symbols () && !have_partial_symbols () && block == NULL)
error (_("No symbol table is loaded. Use the \"file\" command."));
- if (block == expression_context_block)
+ if (block == par_state->expression_context_block)
error (_("No definition of \"%s\" in current context."), name0.ptr);
else
error (_("No definition of \"%s\" in specified context."), name0.ptr);
@@ -1376,7 +1376,8 @@ write_name_assoc (struct parser_state *par_state, struct stoken name)
if (strchr (name.ptr, '.') == NULL)
{
std::vector<struct block_symbol> syms;
- int nsyms = ada_lookup_symbol_list (name.ptr, expression_context_block,
+ int nsyms = ada_lookup_symbol_list (name.ptr,
+ par_state->expression_context_block,
VAR_DOMAIN, &syms);
if (nsyms != 1 || SYMBOL_CLASS (syms[0].symbol) == LOC_TYPEDEF)