aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorSanimir Agovic <sanimir.agovic@intel.com>2013-10-09 15:28:22 +0100
committerJoel Brobecker <brobecker@adacore.com>2014-04-14 09:11:48 -0700
commit4ad88275f81a586e32e86351cc415a97d58ef448 (patch)
tree0dfd1e5cb7622596da1bee79b7148cedcff66fe6 /gdb/value.c
parent80180f796d366d230822c07a15aa68971abf9d77 (diff)
downloadbinutils-4ad88275f81a586e32e86351cc415a97d58ef448.zip
binutils-4ad88275f81a586e32e86351cc415a97d58ef448.tar.gz
binutils-4ad88275f81a586e32e86351cc415a97d58ef448.tar.bz2
vla: enable sizeof operator to work with variable length arrays
In C99 the sizeof operator computes the size of a variable length array at runtime (6.5.3.4 The sizeof operator). This patch reflects the semantic change in the debugger. We now are able to get the size of a vla: 1| void foo (size_t n) { 2| int vla[n]; 3| } (gdb) p sizeof(vla) yields N * sizeof(int). gdb/ChangeLog: * eval.c (evaluate_subexp_for_sizeof) <OP_VAR_VALUE>: If the type passed to sizeof is dynamic evaluate the argument to compute the length.
Diffstat (limited to 'gdb/value.c')
0 files changed, 0 insertions, 0 deletions