From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12990 invoked by alias); 31 Mar 2006 07:36:07 -0000 Received: (qmail 12982 invoked by uid 22791); 31 Mar 2006 07:36:06 -0000 X-Spam-Check-By: sourceware.org Received: from uproxy.gmail.com (HELO uproxy.gmail.com) (66.249.92.207) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 31 Mar 2006 07:36:05 +0000 Received: by uproxy.gmail.com with SMTP id m2so337522ugc for ; Thu, 30 Mar 2006 23:36:02 -0800 (PST) Received: by 10.66.252.9 with SMTP id z9mr69664ugh; Thu, 30 Mar 2006 23:36:02 -0800 (PST) Received: from ?192.168.1.151? ( [82.24.24.234]) by mx.gmail.com with ESMTP id m1sm587022uge.2006.03.30.23.36.02; Thu, 30 Mar 2006 23:36:02 -0800 (PST) Message-ID: <442CCE46.7080800@gmail.com> Date: Fri, 31 Mar 2006 08:19:00 -0000 From: Bill Pursell User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc3 (X11/20050929) MIME-Version: 1.0 To: Jim Blandy CC: gdb@sourceware.org Subject: Re: scope in nested function References: <442CC4BB.5070709@gmail.com> <8f2776cb0603302257t14f38361ibf8ab1cb74dfb774@mail.gmail.com> In-Reply-To: <8f2776cb0603302257t14f38361ibf8ab1cb74dfb774@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00230.txt.bz2 Jim Blandy wrote: > 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. > I get the error: Can't find member of namespace, class, struct, or union named "main::foo" Same for main::i