This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 05/10] vla: allow side effects for sizeof argument
- From: Tom Tromey <tromey at redhat dot com>
- To: Sanimir Agovic <sanimir dot agovic at intel dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 24 Oct 2013 13:55:09 -0600
- Subject: Re: [PATCH 05/10] vla: allow side effects for sizeof argument
- Authentication-results: sourceware.org; auth=none
- References: <1382366424-21010-1-git-send-email-sanimir dot agovic at intel dot com> <1382366424-21010-6-git-send-email-sanimir dot agovic at intel dot com>
>>>>> "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