From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24485 invoked by alias); 6 Jan 2007 11:14:05 -0000 Received: (qmail 24476 invoked by uid 22791); 6 Jan 2007 11:14:04 -0000 X-Spam-Check-By: sourceware.org Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 06 Jan 2007 11:13:59 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.50) id 1H39Uk-0004R7-RW for gdb@sources.redhat.com; Sat, 06 Jan 2007 14:13:56 +0300 Received: from localhost ([127.0.0.1] helo=ip6-localhost) by zigzag.lvk.cs.msu.su with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.50) id 1H39UX-0004QR-ND; Sat, 06 Jan 2007 14:13:37 +0300 From: Vladimir Prus To: Eli Zaretskii Subject: Re: -var-list --locals proposal Date: Sat, 06 Jan 2007 11:14:00 -0000 User-Agent: KMail/1.9.1 Cc: gdb@sources.redhat.com References: <200701052303.59465.ghost@cs.msu.su> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200701061412.54562.ghost@cs.msu.su> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-01/txt/msg00103.txt.bz2 On Saturday 06 January 2007 13:39, Eli Zaretskii wrote: > > From: Vladimir Prus > > Date: Fri, 5 Jan 2007 23:03:59 +0300 > > > > I propose to introduce a new command: > > > > -var-list --locals > > As you explain further, this will actually list all variables that are > visible in the current scope. So a better name for this command would > be something like "-var-list --scope FRAME" or "-var-list --frame FRAME". At the moment, the "KIND" option to -var-list is document as the kind of objects for which varobjs are creates. Say -var-list --registers ... creates varobjs for registers and -var-list --locals will create varobjs for locals. On the contrary, -var-list --frame would be somewhat inconsistent -- it does not create varobjs for frames. > > I think that to avoid creating and destroying variable > > objects as we step though inner blocks, -var-list should construct > > varobjs for all variables in all blocks of a function. > > Won't lazy creation (on as needed basis) be a better strategy? It might be more efficient. However, different frontend have different ideas how to show local vars. I believe that XCode, for example, shows all locals as soon as you enter the function. Lazy creation would prevent such usage. - Volodya