PR 17564: Fix objfile search order for static symbols.
authorDoug Evans <xdje42@gmail.com>
Mon, 10 Nov 2014 23:48:49 +0000 (15:48 -0800)
committerDoug Evans <xdje42@gmail.com>
Mon, 10 Nov 2014 23:48:49 +0000 (15:48 -0800)
commitaf3768e945b188caa141e3285dc3eb84f440a673
tree6389063c6fd6e548806d7d7b35b57b5a0ef42e9d
parentc4bfc839ee132ad8f925800410f4b5bb7ff0fb0d
PR 17564: Fix objfile search order for static symbols.

When searching static symbols, gdb would search over all
expanded symtabs of all objfiles, and if that fails only then
would it search all partial/gdb_index tables of all objfiles.
This means that the user could get a random instance of the
symbol depending on what symtabs have been previously expanded.
Now the search is consistent, searching each objfile completely
before proceeding to the next one.

gdb/ChangeLog:

PR symtab/17564
* symtab.c (lookup_symbol_in_all_objfiles): Delete.
(lookup_static_symbol): Move definition to new location and rewrite.
(lookup_symbol_in_objfile): New function.
(lookup_symbol_global_iterator_cb): Call it.

gdb/testsuite/ChangeLog:

PR symtab/17564
* gdb.base/symtab-search-order.exp: New file.
* gdb.base/symtab-search-order.c: New file.
* gdb.base/symtab-search-order-1.c: New file.
* gdb.base/symtab-search-order-shlib-1.c: New file.
gdb/ChangeLog
gdb/symtab.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/symtab-search-order-1.c [new file with mode: 0644]
gdb/testsuite/gdb.base/symtab-search-order-shlib-1.c [new file with mode: 0644]
gdb/testsuite/gdb.base/symtab-search-order.c [new file with mode: 0644]
gdb/testsuite/gdb.base/symtab-search-order.exp [new file with mode: 0644]
This page took 0.028313 seconds and 4 git commands to generate.