From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13663 invoked by alias); 26 Jan 2006 23:31:01 -0000 Received: (qmail 13651 invoked by uid 22791); 26 Jan 2006 23:31:00 -0000 X-Spam-Check-By: sourceware.org Received: from xproxy.gmail.com (HELO xproxy.gmail.com) (66.249.82.205) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 26 Jan 2006 23:30:58 +0000 Received: by xproxy.gmail.com with SMTP id t11so306522wxc for ; Thu, 26 Jan 2006 15:30:56 -0800 (PST) Received: by 10.70.95.17 with SMTP id s17mr1280554wxb; Thu, 26 Jan 2006 15:30:56 -0800 (PST) Received: by 10.70.75.18 with HTTP; Thu, 26 Jan 2006 15:30:56 -0800 (PST) Message-ID: Date: Thu, 26 Jan 2006 23:33:00 -0000 From: Igor Khavkine To: gdb@sourceware.org, Daniel Jacobowitz Subject: Re: C99 variable length arrays In-Reply-To: <20060126134926.GA3501@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20060126134926.GA3501@nevyn.them.org> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00288.txt.bz2 On 1/26/06, Daniel Jacobowitz wrote: > On Thu, Jan 26, 2006 at 08:41:46AM -0500, Igor Khavkine wrote: > > I'm using GDB to debug some code that uses local variable length > > arrays. This feature is available for C as of the C99 standard. GCC > > has support for it. > > > > Sadly, GDB doesn't seem to be smart enough to figure out the size of > > the arrays at run time. This leads to things like 'print array[1][2]' > > at the GDB prompt not printing the same value as would 'printf("%g\n", > > array[1][2])' in the code. This is a problem for multidimensional > > arrays especially. Needless to say, this makes the code more difficult > > to debug. > > The first thing to do is to write a small testcase, and post the > testcase along with the debugging output that your GCC generates > for it. There is a test case already in the GDB bug database (PR 1796, as I mentioned in my first message). What kind of debugging output should I post? Is there an option to make gcc dump the debugging info in human readable form? Thanks in advance. Igor