aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/symtab-search-order-1.c
diff options
context:
space:
mode:
authorDoug Evans <xdje42@gmail.com>2014-11-10 15:48:49 -0800
committerDoug Evans <xdje42@gmail.com>2014-11-10 15:48:49 -0800
commitaf3768e945b188caa141e3285dc3eb84f440a673 (patch)
tree6389063c6fd6e548806d7d7b35b57b5a0ef42e9d /gdb/testsuite/gdb.base/symtab-search-order-1.c
parentc4bfc839ee132ad8f925800410f4b5bb7ff0fb0d (diff)
downloadgdb-af3768e945b188caa141e3285dc3eb84f440a673.zip
gdb-af3768e945b188caa141e3285dc3eb84f440a673.tar.gz
gdb-af3768e945b188caa141e3285dc3eb84f440a673.tar.bz2
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.
Diffstat (limited to 'gdb/testsuite/gdb.base/symtab-search-order-1.c')
-rw-r--r--gdb/testsuite/gdb.base/symtab-search-order-1.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/symtab-search-order-1.c b/gdb/testsuite/gdb.base/symtab-search-order-1.c
new file mode 100644
index 0000000..bff9b7a
--- /dev/null
+++ b/gdb/testsuite/gdb.base/symtab-search-order-1.c
@@ -0,0 +1 @@
+static int static_global = 23;