From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31205 invoked by alias); 14 Nov 2009 09:36:08 -0000 Received: (qmail 31197 invoked by uid 22791); 14 Nov 2009 09:36:07 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout20.012.net.il (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 14 Nov 2009 09:35:03 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0KT300600EB75S00@a-mtaout20.012.net.il> for gdb-patches@sourceware.org; Sat, 14 Nov 2009 11:35:00 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.70.37.193]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KT30015UEMBWVA0@a-mtaout20.012.net.il>; Sat, 14 Nov 2009 11:35:00 +0200 (IST) Date: Sat, 14 Nov 2009 09:36:00 -0000 From: Eli Zaretskii Subject: Re: RFC: Skip declarations in "info variables" In-reply-to: <20091113214448.GA30270@caradoc.them.org> To: Daniel Jacobowitz Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <833a4ho3ej.fsf@gnu.org> References: <20091113214448.GA30270@caradoc.them.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-11/txt/msg00327.txt.bz2 > Date: Fri, 13 Nov 2009 16:44:48 -0500 > From: Daniel Jacobowitz > > The second problem is that integer is listed twice. Jan pointed me to > GCC PR 37982; the file has a declaration and definition for the > variable if it is referenced (only a definition, otherwise). > I don't think we should display the declaration. So I've changed > search_symbols not to display variables of class LOC_UNRESOLVED, and > updated the documentation to match. While this is a change of > behavior, I don't think it's problematic. To decide whether or not this is a Good Thing, we need to answer a question: What is the purpose of "info variables"? More specifically, what are the main use-cases for using it? Can people please share their experience with this command? Without that, I'm not sure we are not removing a potentially useful behavior. Alternatively, we could add a new `info' command, or a variant of "info variables", that would show the declared variables as well. Then we don't need to worry about the possibility of removing useful functionality. > Index: src/gdb/doc/gdb.texinfo > =================================================================== > --- src.orig/gdb/doc/gdb.texinfo 2009-11-13 16:28:20.000000000 -0500 > +++ src/gdb/doc/gdb.texinfo 2009-11-13 16:28:43.000000000 -0500 > @@ -12920,7 +12920,7 @@ that conflict with the regular expressio > > @kindex info variables > @item info variables > -Print the names and data types of all variables that are declared > +Print the names and data types of all variables that are defined > outside of functions (i.e.@: excluding local variables). > > @item info variables @var{regexp} This is an almost mechanical change, so okay. But I think we need a NEWS entry about the behavior change.