From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 853 invoked by alias); 22 Feb 2005 20:27:42 -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 785 invoked from network); 22 Feb 2005 20:27:37 -0000 Received: from unknown (HELO av.mvista.com) (12.44.186.158) by sourceware.org with SMTP; 22 Feb 2005 20:27:37 -0000 Received: from [10.0.10.24] (av [127.0.0.1]) by av.mvista.com (8.9.3/8.9.3) with ESMTP id MAA23580; Tue, 22 Feb 2005 12:27:33 -0800 Message-ID: <421B94FD.5060502@mvista.com> Date: Tue, 22 Feb 2005 20:45:00 -0000 From: Cal Erickson Reply-To: cerickson@mvista.com Organization: MontaVista Software, Inc. User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) MIME-Version: 1.0 To: Paul Hilfinger CC: tj <999alfred@comcast.net>, gdb@sources.redhat.com Subject: Re: Still problems with gdb and nested functions. References: <200502222015.j1MKFB1q017797@tully.CS.Berkeley.EDU> In-Reply-To: <200502222015.j1MKFB1q017797@tully.CS.Berkeley.EDU> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-02/txt/msg00139.txt.bz2 You might try updating your GCC release. We found the same problem and it was fixed by upgrading GCC. Cal Erickson Paul Hilfinger wrote: >>#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; >>} >> > > .... > >>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. > > > I presume you have confirmed that k is actually there (since it is set > only from a constant, it could be folded away even without fancy > optimization). > > Paul Hilfinger -- =========================================================================== Cal Erickson MontaVista Software Inc. Linux Consultant 1237 E. Arques Ave. Phone (408) 328-0304 Sunnyvale CA 94085 Fax (408) 328-9204 web http://www.mvista.com ===========================================================================