This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Skip declarations in "info variables"

> 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

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

> 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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]