From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27913 invoked by alias); 31 Mar 2006 06:57:53 -0000 Received: (qmail 27888 invoked by uid 22791); 31 Mar 2006 06:57:52 -0000 X-Spam-Check-By: sourceware.org Received: from xproxy.gmail.com (HELO xproxy.gmail.com) (66.249.82.199) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 31 Mar 2006 06:57:51 +0000 Received: by xproxy.gmail.com with SMTP id s16so454103wxc for ; Thu, 30 Mar 2006 22:57:49 -0800 (PST) Received: by 10.70.75.16 with SMTP id x16mr137606wxa; Thu, 30 Mar 2006 22:57:49 -0800 (PST) Received: by 10.70.126.16 with HTTP; Thu, 30 Mar 2006 22:57:49 -0800 (PST) Message-ID: <8f2776cb0603302257t14f38361ibf8ab1cb74dfb774@mail.gmail.com> Date: Fri, 31 Mar 2006 07:54:00 -0000 From: "Jim Blandy" To: "Bill Pursell" Subject: Re: scope in nested function Cc: gdb@sourceware.org In-Reply-To: <442CC4BB.5070709@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <442CC4BB.5070709@gmail.com> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00229.txt.bz2 On 3/30/06, Bill Pursell wrote: > I'm not sure how to reference a variable in a nested function from gdb. > In the gdb session below, there are 2 things I don't understand > how to do: > > 1) how do I set a breakpoint in foo? (other than by referencing a line > number) Have you tried calling it main::foo? > 2) when I'm in foo, how do I reference i? Have you tried calling it main::i? I'm not sure these will work, but I think they're supposed to.