This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]