Search global block from basic_lookup_symbol_nonlocal
This changes lookup_global_symbol to look in the global block
of the passed-in block. If no block was passed in, it reverts to the
previous behavior.
This change is needed to ensure that 'FILENAME'::NAME lookups work
properly. As debugging Pedro's test case showed, this was not working
properly in the case where multiple identical names could be found
(the one situation where this feature is truly needed :-).
This also removes some old comments from basic_lookup_symbol_nonlocal
that no longer apply.
Note that the new test cases for this change will appear in a later
patch. They are in gdb.base/print-file-var.exp.
gdb/ChangeLog
2019-10-02 Andrew Burgess <andrew.burgess@embecosm.com>
* symtab.c (lookup_global_symbol): Search global block.