diff options
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/eval.c | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cf9a35d..1755609 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,4 +1,9 @@ 2014-04-14 Sanimir Agovic <sanimir.agovic@intel.com> + + * eval.c (evaluate_subexp_for_sizeof) <OP_VAR_VALUE>: If the type + passed to sizeof is dynamic evaluate the argument to compute the length. + +2014-04-14 Sanimir Agovic <sanimir.agovic@intel.com> Joel Brobecker <brobecker@adacore.com> * dwarf2loc.c (dwarf2_locexpr_baton_eval): New function. @@ -3040,8 +3040,14 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos) break; case OP_VAR_VALUE: - (*pos) += 4; type = SYMBOL_TYPE (exp->elts[pc + 2].symbol); + if (is_dynamic_type (type)) + { + val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_NORMAL); + type = value_type (val); + } + else + (*pos) += 4; break; default: |