diff options
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/eval.c | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ebeb2ef..1b989ae 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2014-04-11 Sanimir Agovic <sanimir.agovic@intel.com> + * eval.c (evaluate_subexp_for_sizeof) <UNOP_IND>: Create an indirect + value and retrieve the dynamic type size. + +2014-04-11 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. @@ -3026,6 +3026,8 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos) && TYPE_CODE (type) != TYPE_CODE_ARRAY) error (_("Attempt to take contents of a non-pointer value.")); type = check_typedef (TYPE_TARGET_TYPE (type)); + if (is_dynamic_type (type)) + type = value_type (value_ind (val)); return value_from_longest (size_type, (LONGEST) TYPE_LENGTH (type)); case UNOP_MEMVAL: |