From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28379 invoked by alias); 22 Feb 2005 19:17:38 -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 28366 invoked from network); 22 Feb 2005 19:17:34 -0000 Received: from unknown (HELO rwcrmhc13.comcast.net) (204.127.198.39) by sourceware.org with SMTP; 22 Feb 2005 19:17:34 -0000 Received: from comcast.net (pcp08729402pcs.grey01.tn.comcast.net[69.139.105.250]) by comcast.net (rwcrmhc13) with SMTP id <2005022219173301500l0blse>; Tue, 22 Feb 2005 19:17:34 +0000 Message-ID: <421B8556.6070905@comcast.net> Date: Tue, 22 Feb 2005 19:31:00 -0000 From: tj <999alfred@comcast.net> User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030915 MIME-Version: 1.0 To: gdb@sources.redhat.com Subject: Still problems with gdb and nested functions. Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-02/txt/msg00136.txt.bz2 I posted before about gdb not printing local variables when within nested functions and I thought the problem had been solved when it was mentioned my demo worked when using gdb 6.1, which I upgraded to. BUt, now I have discovered even it has a problem. Sample file: #include int main(int argc, char *argv[]){ int i,j; int inside(void){ int k,l; k = 1; l = k; printf("inside, k = %d, l = %d\n", k,l); return 0; } inside(); i = 0; j = 1; } Now, run gdb and do the following: (gdb) b test.c:12 Breakpoint 1 at 0x8048352: file test.c, line 12. (gdb) b test.c:19 Breakpoint 2 at 0x804838d: file test.c, line 19. (gdb) run Starting program: /home/wd4nmq/src/test/test/a.out Breakpoint 1, inside.0 () at test.c:12 12 printf("inside, k = %d, l = %d\n", k,l); (gdb) p k No symbol "k" in current context. (gdb) continue Continuing. inside, k = 1, l = 1 Breakpoint 2, main (argc=1, argv=0xbffff964) at test.c:19 19 j = 1; (gdb) p i $1 = 0 (gdb) While it now prints the value of i, which it wasn't pre v6.1, but it still doesn't print the k value when stopped within the inside() function, where it is in scope. Oh well, at least is some progress :-). gcc 3.23 gdb 6.1 tj