aboutsummaryrefslogtreecommitdiff
path: root/gdb/parse.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-03-08 07:27:57 -0700
committerTom Tromey <tom@tromey.com>2021-03-08 07:28:44 -0700
commit9c79936b3df018166d53869f7f2bb2909f129e51 (patch)
treea878d993489408177c7d6b6a724276b30aed2b1d /gdb/parse.c
parent40d07d07d051308626f6079fa6d1598fafb445c7 (diff)
downloadgdb-9c79936b3df018166d53869f7f2bb2909f129e51.zip
gdb-9c79936b3df018166d53869f7f2bb2909f129e51.tar.gz
gdb-9c79936b3df018166d53869f7f2bb2909f129e51.tar.bz2
Use bound_minimal_symbol in var_msym_value_operation
This changes var_msym_value_operation to use a bound_minimal_symbol rather than separate minsym and objfile parameters. The main benefit of this is removing the possibly-confusing check_objfile overload for a plain minimal symbol. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * parse.c (parser_state::push_symbol, parser_state::push_dollar): Update. * p-exp.y (variable): Update. * go-exp.y (variable): Update. * expprint.c (dump_for_expression): Use bound_minimal_symbol. Remove overload for objfile. * expop.h (eval_op_var_msym_value): Use bound_minimal_symbol parameter. (check_objfile): Likewise. (dump_for_expression): Likewise. Remove overload for objfile. (class var_msym_value_operation): Use bound_minimal_symbol. * eval.c (eval_op_var_msym_value): Use bound_minimal_symbol parameter. (var_msym_value_operation::evaluate_for_address) (var_msym_value_operation::evaluate_for_sizeof) (var_msym_value_operation::evaluate_for_cast): Update. * d-exp.y (PrimaryExpression): Update. * c-exp.y (variable): Update. * ax-gdb.c (var_msym_value_operation::do_generate_ax): Update. * ada-lang.c (ada_var_msym_value_operation::evaluate_for_cast): Update. * ada-exp.y (write_var_or_type): Update.
Diffstat (limited to 'gdb/parse.c')
-rw-r--r--gdb/parse.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/parse.c b/gdb/parse.c
index 966b27e..692d38d 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -230,8 +230,7 @@ parser_state::push_symbol (const char *name, block_symbol sym)
{
struct bound_minimal_symbol msymbol = lookup_bound_minimal_symbol (name);
if (msymbol.minsym != NULL)
- push_new<expr::var_msym_value_operation> (msymbol.minsym,
- msymbol.objfile);
+ push_new<expr::var_msym_value_operation> (msymbol);
else if (!have_full_symbols () && !have_partial_symbols ())
error (_("No symbol table is loaded. Use the \"file\" command."));
else
@@ -308,7 +307,7 @@ parser_state::push_dollar (struct stoken str)
msym = lookup_bound_minimal_symbol (copy.c_str ());
if (msym.minsym)
{
- push_new<expr::var_msym_value_operation> (msym.minsym, msym.objfile);
+ push_new<expr::var_msym_value_operation> (msym);
return;
}