diff options
author | Tom Tromey <tom@tromey.com> | 2021-03-08 07:27:57 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-03-08 07:28:15 -0700 |
commit | 0c8effa32e9326ca80f3e7cd74635e1dc44b3db5 (patch) | |
tree | b6d0af9e6efda5de07f2df3885b698eb24756f0c /gdb/ax-gdb.c | |
parent | d336c29e3f1b9adc314fcf44af38fb1d2b65b5e6 (diff) | |
download | gdb-0c8effa32e9326ca80f3e7cd74635e1dc44b3db5.zip gdb-0c8effa32e9326ca80f3e7cd74635e1dc44b3db5.tar.gz gdb-0c8effa32e9326ca80f3e7cd74635e1dc44b3db5.tar.bz2 |
Introduce var_msym_value_operation
This adds class var_msym_value_operation, which implements
OP_VAR_MSYM_VALUE. A new method is added to class operation in order
to support a special case in minsym evaluation.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* expression.h (class operation) <set_outermost>: New method.
* expop.h (class var_msym_value_operation): New.
* eval.c (eval_op_var_msym_value): No longer static.
(var_msym_value_operation::evaluate_for_address)
(var_msym_value_operation::evaluate_for_sizeof)
(var_msym_value_operation::evaluate_for_cast): New methods.
* ax-gdb.c (var_msym_value_operation::do_generate_ax): New
method.
Diffstat (limited to 'gdb/ax-gdb.c')
-rw-r--r-- | gdb/ax-gdb.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index 7640b1b..6028170 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -2324,6 +2324,23 @@ long_const_operation::do_generate_ax (struct expression *exp, std::get<0> (m_storage)); } +void +var_msym_value_operation::do_generate_ax (struct expression *exp, + struct agent_expr *ax, + struct axs_value *value, + struct type *cast_type) +{ + gen_msym_var_ref (ax, value, std::get<0> (m_storage), + std::get<1> (m_storage)); + + if (value->type->code () == TYPE_CODE_ERROR) + { + if (cast_type == nullptr) + error_unknown_type (std::get<0> (m_storage)->linkage_name ()); + value->type = cast_type; + } +} + } /* This handles the middle-to-right-side of code generation for binary |