* NEWS: Document "info variables" change.
authorDaniel Jacobowitz <drow@false.org>
Mon, 28 Dec 2009 21:29:53 +0000 (21:29 +0000)
committerDaniel Jacobowitz <drow@false.org>
Mon, 28 Dec 2009 21:29:53 +0000 (21:29 +0000)
* 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.

gdb/ChangeLog
gdb/NEWS
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/dwarf2read.c
gdb/symtab.c

index a12ca6ba266b92b67249805b720810fd1d321c54..6ccb88b89487e6f9914c7a98a1d53008c4d08dd5 100644 (file)
@@ -1,3 +1,10 @@
+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
index 9061dbf79e7bb9e7bccef29478dd6de2a73f5973..8c0fd92b9fff5c597f49b35cac4852a7a5b918c7 100644 (file)
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -30,6 +30,10 @@ disassemble
   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>]
index aa6ab58c049d7774b472ece9558ec3b56e8440c8..bd4d5d11d0186717b79871b0cd7bd2272e15aea3 100644 (file)
@@ -1,3 +1,8 @@
+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
index 40bbe076d6f001f841a0c6f128dea220ce9371f5..308834f4423af087b1bb67754bcc26dcf427edfc 100644 (file)
@@ -12924,7 +12924,7 @@ that conflict with the regular expression language (e.g.@:
 
 @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}
index ffeaaf2331b58a7a8bebbe3e91b5f5a3e0971b0f..2205ef72d51dc3be91c07c61f00515dfeff5a701 100644 (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))
                {
index 950be267f60c159cd33a122dd4167f1b49c3f79f..cba9e6886d58d076dfd41fb5c7ce9bd79e4b81ef 100644 (file)
@@ -3296,7 +3296,9 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
                && ((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))))
              {
@@ -3372,6 +3374,7 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
                  && ((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)