From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18081 invoked by alias); 19 Feb 2005 19:03:30 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 18063 invoked from network); 19 Feb 2005 19:03:26 -0000 Received: from unknown (HELO romy.inter.net.il) (192.114.186.66) by sourceware.org with SMTP; 19 Feb 2005 19:03:26 -0000 Received: from zaretski (pns03-208-119.inter.net.il [80.230.208.119]) by romy.inter.net.il (MOS 3.5.6-GR) with ESMTP id AOP10801 (AUTH halo1); Sat, 19 Feb 2005 21:03:23 +0200 (IST) Date: Sat, 19 Feb 2005 22:27:00 -0000 From: "Eli Zaretskii" To: tj <999alfred@comcast.net> Message-ID: <01c516b5$Blat.v2.4$ade6c180@zahav.net.il> Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=ISO-8859-1 CC: gdb@sources.redhat.com In-reply-to: <42176883.2020508@comcast.net> (message from tj on Sat, 19 Feb 2005 11:25:39 -0500) Subject: Re: Cann't print local vars when nesting functions Reply-to: Eli Zaretskii References: <42167219.8070507@comcast.net> <01c51674$Blat.v2.4$be4a87a0@zahav.net.il> <42176883.2020508@comcast.net> X-SW-Source: 2005-02/txt/msg00125.txt.bz2 > Date: Sat, 19 Feb 2005 11:25:39 -0500 > From: tj <999alfred@comcast.net> > CC: gdb@sources.redhat.com > > I am on linux, 2.4.26 kernel > gcc 3.2.3 > gdb 5.3 > Source file test.c: > #include > > int main(int argc, char *argv[]){ > > int i,j; > int inside(void){ > int k,l; > > k = 1; > l = k; > return 0; > > } > > i = 0; > j = 1; > } > > test$ cc -g -O0 test.c > $ gdb ./a.out > GNU gdb 5.3 > Copyright 2002 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you are > welcome to change it and/or distribute copies of it under certain > conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for details. > This GDB was configured as "i386-slackware-linux"... > (gdb) b test.c:16 > Breakpoint 1 at 0x8048340: file test.c, line 16. > (gdb) run > Starting program: test/a.out > > Breakpoint 1, main () at test.c:16 > 16 j = 1; > (gdb) p i > No symbol "i" in current context. > (gdb) Well, all I can say that with GDB 6.1 and 6.3 I don't see this problem. Unless someone who knows more than I do about problems specific to GNU/Linux, I'd suggest to upgrade to newer versions of GCC and GDB, and see if the problem goes away.