This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
exp/2558: Variable length arrays not interpreted correctly
- From: jed at 59a2 dot org
- To: gdb-gnats at sources dot redhat dot com
- Date: 25 Nov 2008 16:09:41 -0000
- Subject: exp/2558: Variable length arrays not interpreted correctly
- Reply-to: jed at 59a2 dot org
>Number: 2558
>Category: exp
>Synopsis: Variable length arrays not interpreted correctly
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Tue Nov 25 16:18:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: Jed Brown
>Release: 6.8
>Organization:
>Environment:
Linux brakk 2.6.27-ARCH #1 SMP PREEMPT Fri Nov 14 08:56:10 UTC 2008 x86_64 Intel(R) Core(TM)2 Duo CPU T9300 @ 2.50GHz GenuineIntel GNU/Linux
>Description:
Variable length arrays are interpreted as zero-length arrays. Similarly, pointers to VLA are not resolved properly.
>How-To-Repeat:
int test(int n)
{
int a[n];
return 0;
}
Set a breakpoint at `return 0;'
(gdb) p n
$1 = 3
(gdb) p a
$2 = 0x7fff4b30b7c0
(gdb) p sizeof(a)
$3 = 0
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: