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

	doc/
	* gdb.texinfo (Symbols): "info variables" prints definitions, not
	declarations.
This commit is contained in:
Daniel Jacobowitz 2009-12-28 21:29:53 +00:00
parent 22e722e199
commit 0fe7935b33
6 changed files with 29 additions and 3 deletions

View file

@ -8463,8 +8463,15 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
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))
{