From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7072 invoked by alias); 18 Feb 2005 22:54:18 -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 6989 invoked from network); 18 Feb 2005 22:54:12 -0000 Received: from unknown (HELO sccrmhc11.comcast.net) (204.127.202.55) by sourceware.org with SMTP; 18 Feb 2005 22:54:12 -0000 Received: from comcast.net (pcp08729402pcs.grey01.tn.comcast.net[69.139.105.250]) by comcast.net (sccrmhc11) with SMTP id <2005021822541201100t4oc0e>; Fri, 18 Feb 2005 22:54:12 +0000 Message-ID: <42167219.8070507@comcast.net> Date: Sat, 19 Feb 2005 01:00:00 -0000 From: Jeff 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: Cann't print local vars when nesting functions Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-02/txt/msg00120.txt.bz2 I am having problems printing local stack variables when nesting functions. Here is a test app: int main(int argc, char *argv[]){ int i,j; i = 0; j = 1; } Now, run it to break on line: j = 1; and then: (gdb) p i $2 = 0 and all is ok. but change to this: int main(int argc, char *argv[]){ int i,j; int inside(void){ int k,l; k = 3; l = 4; } i = 0; j = 1; } Now set the break point to the same line, j =1, and this happens: Breakpoint 1, main () at test.c:25 25 j = 1; (gdb) p i No symbol "i" in current context. (gdb) What gives? Is there something you need to special when nesting functions? tj