]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
fix
authorTom de Vries <tdevries@suse.de>
Tue, 22 Jun 2021 06:09:11 +0000 (08:09 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 24 Jun 2021 15:59:27 +0000 (17:59 +0200)
gdb/psympriv.h
gdb/psymtab.c

index feced066cb6842119903c4d5acd61d8f4805f4d3..0d1507b14724294d3aaeedd7869523eeba75d567 100644 (file)
@@ -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;
index 6e55d0fdb8f5f8dd7ef82838563c69a7a2e119c3..c4808bc2cd06b5958acac5932e72662d841cd80c 100644 (file)
@@ -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);