[PATCH 05/10] vla: allow side effects for sizeof argument

Tom Tromey tromey@redhat.com
Thu Oct 24 19:55:00 GMT 2013


>>>>> "Sanimir" == Sanimir Agovic <sanimir.agovic@intel.com> writes:

Sanimir> C99 requires the sizeof operator to be evaluated at runtime to compute
Sanimir> the size of the vla, reflect this behavior in gdb.

Sanimir> -      val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
Sanimir> +      val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_NORMAL);

I think this will do the wrong thing for cases like (assuming "int x"):

    (gdb) print sizeof (x++)

I think some other approach will be needed for this patch.

Tom



More information about the Gdb-patches mailing list