2009-12-28 Daniel Jacobowitz <dan@codesourcery.com>
+ * NEWS: Document "info variables" change.
+ * dwarf2read.c (new_symbol): Add file-scope external unresolved
+ symbols to global_symbols.
+ * symtab.c (search_symbols): Skip LOC_UNRESOLVED symbols.
+
+2009-12-28 Daniel Jacobowitz <dan@codesourcery.com>
+
* defs.h (print_address_symbolic, build_address_symbolic): Update
prototypes.
* printcmd.c (print_address_symbolic): Take a gdbarch argument.
The disassemble command, when invoked with two arguments, now requires
the arguments to be comma-separated.
+info variables
+ The info variables command now displays variable definitions. Files
+ which only declare a variable are not shown.
+
* New commands (for set/show, see "New options" below)
record save [<FILENAME>]
+2009-12-28 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * gdb.texinfo (Symbols): "info variables" prints definitions, not
+ declarations.
+
2009-12-21 Vladimir Prus <vladimir@codesourcery.com>
* gdb.texinfo (GDB/MI Miscellaneous Commands): Clarify that
@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}
if (attr2 && (DW_UNSND (attr2) != 0)
&& dwarf2_attr (die, DW_AT_type, cu) != NULL)
{
+ struct pending **list_to_add;
+
+ /* A variable with DW_AT_external is never static, but it
+ may be block-scoped. */
+ list_to_add = (cu->list_in_scope == &file_symbols
+ ? &global_symbols : cu->list_in_scope);
+
SYMBOL_CLASS (sym) = LOC_UNRESOLVED;
- add_symbol_to_list (sym, cu->list_in_scope);
+ add_symbol_to_list (sym, list_to_add);
}
else if (!die_is_declaration (die, cu))
{
&& ((regexp == NULL
|| re_exec (SYMBOL_NATURAL_NAME (*psym)) != 0)
&& ((kind == VARIABLES_DOMAIN && SYMBOL_CLASS (*psym) != LOC_TYPEDEF
- && SYMBOL_CLASS (*psym) != LOC_BLOCK)
+ && SYMBOL_CLASS (*psym) != LOC_UNRESOLVED
+ && SYMBOL_CLASS (*psym) != LOC_BLOCK
+ && SYMBOL_CLASS (*psym) != LOC_CONST)
|| (kind == FUNCTIONS_DOMAIN && SYMBOL_CLASS (*psym) == LOC_BLOCK)
|| (kind == TYPES_DOMAIN && SYMBOL_CLASS (*psym) == LOC_TYPEDEF))))
{
&& ((regexp == NULL
|| re_exec (SYMBOL_NATURAL_NAME (sym)) != 0)
&& ((kind == VARIABLES_DOMAIN && SYMBOL_CLASS (sym) != LOC_TYPEDEF
+ && SYMBOL_CLASS (sym) != LOC_UNRESOLVED
&& SYMBOL_CLASS (sym) != LOC_BLOCK
&& SYMBOL_CLASS (sym) != LOC_CONST)
|| (kind == FUNCTIONS_DOMAIN && SYMBOL_CLASS (sym) == LOC_BLOCK)