This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
C99 variable length array support
- From: Sanimir Agovic <sanimir dot agovic at intel dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 21 Oct 2013 16:40:14 +0200
- Subject: C99 variable length array support
- Authentication-results: sourceware.org; auth=none
Hello,
this patch series add C99 variable length support to gdb.
It allows the user to evaluate a vla like an ordinary static array e.g. print
its elements instead of printing the pointer to the array. In addition the size
of a vla can be retrieved with gdbs builtin sizeof operator.
1| void foo (size_t n) {
2| int ary[n];
3| memset(ary, 0, sizeof(ary));
4| }
(gdb) print ary
$1 = {0 <repeats 42 times>}
(gdb) print sizeof ary
$2 = 42
-Sanimir & Keven