This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] choose symbol from given block's objfile first.


[about needing to update the calls to lookup_symbol_aux_quick]
> Yes, I think you'd need this change there as well.
> 
> gdb should end up in the lookup_symbol_aux_quick loop if the symbol in
> question is in an unexpanded psymtab.  In this case you want to be sure
> to check the block objfile first.

I think I see why I got tricked: Is it because the debug info is DWARF?
With DWARF, the lookup_static_symbol_aux first pre-expands all partial
symbols containing a match, so we never go into the quick method...

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.

OK to commit?
-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]