From: Tom de Vries Date: Tue, 22 Jun 2021 06:09:11 +0000 (+0200) Subject: fix X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4f262e61dda349718662576248a94974cb2216cf;p=thirdparty%2Fbinutils-gdb.git fix --- diff --git a/gdb/psympriv.h b/gdb/psympriv.h index feced066cb6..0d1507b1472 100644 --- a/gdb/psympriv.h +++ b/gdb/psympriv.h @@ -336,9 +336,23 @@ struct partial_symtab return; expansion_state = partial_symtab::lazy; auto it = sect_off.find (psym); + if (it == sect_off.end ()) + { + expansion_state = partial_symtab::full; + return; + } interesting_symbols.emplace (it->second); } + void note_no_interesting_symbol () + { + if (expansion_state == partial_symtab::full) + return; + expansion_state = partial_symtab::full; + interesting_symbols.clear (); + expanded_interesting_symbols = 0; + } + enum expansion_state { unexpanded, lazy, full }; enum expansion_state expansion_state = unexpanded; size_t expanded_interesting_symbols = 0; diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 6e55d0fdb8f..c4808bc2cd0 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -226,7 +226,12 @@ psymbol_functions::find_pc_sect_psymtab (struct objfile *objfile, a worse chosen section due to the TEXTLOW/TEXTHIGH ranges overlap. */ if (lazy_expand_symtab_p && p == nullptr) - p = find_pc_sect_psymbol (objfile, pst, pc, section); + { + struct partial_symbol *p2; + p2 = find_pc_sect_psymbol (objfile, pst, pc, section); + if (p2 == nullptr) + pst->note_no_interesting_symbol (); + } return pst; } @@ -252,7 +257,14 @@ psymbol_functions::find_pc_sect_psymtab (struct objfile *objfile, best_pst = find_pc_sect_psymtab_closer (objfile, pc, section, pst, msymbol); if (best_pst != NULL) - return best_pst; + { + struct partial_symbol *p2; + p2 = find_pc_sect_psymbol (objfile, best_pst, pc, section); + if (p2 == nullptr) + best_pst->note_no_interesting_symbol (); + + return best_pst; + } } return NULL; @@ -1005,10 +1017,16 @@ psymbol_functions::expand_matching_symbols for (partial_symtab *ps : require_partial_symbols (objfile)) { QUIT; - if (!ps->readin_p (objfile) - && match_partial_symbol (objfile, ps, global, name, domain, - ordered_compare)) - psymtab_to_symtab (objfile, ps); + if (ps->readin_p (objfile)) + continue; + + partial_symbol *psym + = match_partial_symbol (objfile, ps, global, name, domain, + ordered_compare); + if (psym == nullptr) + continue; + ps->note_interesting_symbol (psym); + psymtab_to_symtab (objfile, ps); } } @@ -1182,6 +1200,9 @@ psymbol_functions::expand_symtabs_matching *psym_lookup_name, symbol_matcher)) { + if (symbol_matcher == NULL && lookup_name == NULL) + ps->note_no_interesting_symbol (); + struct compunit_symtab *symtab = psymtab_to_symtab (objfile, ps);