aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2021-06-22 08:09:11 +0200
committerTom de Vries <tdevries@suse.de>2021-06-24 17:59:27 +0200
commit4f262e61dda349718662576248a94974cb2216cf (patch)
tree1c4dee54e416761dfc8e84243db824d094863e0e
parent1b36a6700fa01835a511189a3e4f70e1bed94dfb (diff)
downloadbinutils-4f262e61dda349718662576248a94974cb2216cf.zip
binutils-4f262e61dda349718662576248a94974cb2216cf.tar.gz
binutils-4f262e61dda349718662576248a94974cb2216cf.tar.bz2
fix
-rw-r--r--gdb/psympriv.h14
-rw-r--r--gdb/psymtab.c33
2 files changed, 41 insertions, 6 deletions
diff --git a/gdb/psympriv.h b/gdb/psympriv.h
index feced06..0d1507b 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 6e55d0f..c4808bc 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);