From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24251 invoked by alias); 4 Nov 2007 01:52:58 -0000 Received: (qmail 24006 invoked by uid 22791); 4 Nov 2007 01:52:57 -0000 X-Spam-Check-By: sourceware.org Received: from web36815.mail.mud.yahoo.com (HELO web36815.mail.mud.yahoo.com) (209.191.85.66) by sourceware.org (qpsmtpd/0.31) with SMTP; Sun, 04 Nov 2007 01:52:53 +0000 Received: (qmail 34910 invoked by uid 60001); 4 Nov 2007 01:52:51 -0000 X-YMail-OSG: hexd0lEVM1lzFGX44NYNv6wVaI_HJKp0g5ze1ii29fiWRX9vlvwdMaRYbUxnPFJCmFcaReIdpP6Mq_F8riyKOjcww4KRIiLNtj3UHxaiO9EU9JUQEmBEimnoHOyztA-- Received: from [121.44.15.103] by web36815.mail.mud.yahoo.com via HTTP; Sat, 03 Nov 2007 18:52:51 PDT Date: Sun, 04 Nov 2007 01:52:00 -0000 From: D Haley Subject: c++ member arrays with variable size To: gdb@sourceware.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <460780.34754.qm@web36815.mail.mud.yahoo.com> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-11/txt/msg00021.txt.bz2 Hello, I recently was doing some debugging, and came across something new (to me). When debugging routines with arrays that are declared with variable bounds i found that GDB is not able to "see" them. For example #include void foo(unsigned int size); int main() { foo(3); } void foo(unsigned int size) { char bar[size]; int i=1; if(!size) return; std::cerr << bar[0] << std::endl; } upon placing a breakpoint on the std::cerr line, and using "info locals" GDB wont show up the bar variable, nor does trying to print bar work, it claims its not a variable 'no symbol "bar" in current context' Is it possible to identify these in GDB, or alternatively how else can I view these arrays in the debugger, short of rewriting it? Thanks. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com