This is the mail archive of the gdb-prs@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]

exp/2558: Variable length arrays not interpreted correctly


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


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