> Attached are two patches, the first being the code change, and the > second a testcase for it. > > gdb/ChangeLog: > > * findvar.c (default_read_var_value): For LOC_UNRESOLVED symbols, > try locating the symbol in the symbol's own objfile first, before > extending the search to all objfiles. > * symtab.c (lookup_symbol_aux_objfile): New function, extracted > out of lookup_symbol_aux_symtabs. > (lookup_symbol_aux_symtabs): Add new parameter "exclude_objfile". > Replace extracted-out code by call to lookup_symbol_aux_objfile. > Do not search EXCLUDE_OBJFILE. > (lookup_static_symbol_aux): Update call to lookup_symbol_aux_symtabs. > (lookup_symbol_global): Search for matches in the block's objfile > first, before searching all other objfiles. > > gdb/testsuite/ChangeLog: > > * gdb.base/ctxobj-f.c, gdb.base/ctxobj-m.c, gdb.base/ctxobj-v.c, > gdb.base/ctxobj.exp: New files. > > Tested on x86_64-linux. No regression. ENOPATCH. -- Joel