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.
This commit is contained in:
Tom Tromey
2021-03-08 07:27:57 -07:00
parent 40d07d07d0
commit 9c79936b3d
12 changed files with 61 additions and 61 deletions

View File

@ -110,10 +110,11 @@ dump_for_expression (struct ui_file *stream, int depth, symbol *sym)
}
void
dump_for_expression (struct ui_file *stream, int depth, minimal_symbol *msym)
dump_for_expression (struct ui_file *stream, int depth,
bound_minimal_symbol msym)
{
fprintf_filtered (stream, _("%*sMinsym: %s\n"), depth, "",
msym->print_name ());
fprintf_filtered (stream, _("%*sMinsym %s in objfile %s\n"), depth, "",
msym.minsym->print_name (), objfile_name (msym.objfile));
}
void
@ -162,13 +163,6 @@ dump_for_expression (struct ui_file *stream, int depth,
fputs_unfiltered ("\n", stream);
}
void
dump_for_expression (struct ui_file *stream, int depth, objfile *objf)
{
fprintf_filtered (stream, _("%*sObjfile: %s\n"), depth, "",
objfile_name (objf));
}
void
dump_for_expression (struct ui_file *stream, int depth,
enum range_flag flags)