Now that SymbolFileDWARF supports having types in completely separate .pcm file with...
authorGreg Clayton <gclayton@apple.com>
Wed, 10 Feb 2016 21:28:13 +0000 (21:28 +0000)
committerGreg Clayton <gclayton@apple.com>
Wed, 10 Feb 2016 21:28:13 +0000 (21:28 +0000)
    llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files

Each time a SymbolFile::FindTypes() is called, it needs to check the searched_symbol_files list to make sure it hasn't already been asked to find the type and return immediately if it has been checked. This will stop circular dependencies from also crashing LLDB during type queries.

This has proven to be an issue when debugging large applications on MacOSX that use DWARF in .o files.

<rdar://problem/24581488>

llvm-svn: 260434

22 files changed:
lldb/include/lldb/Core/Module.h
lldb/include/lldb/Core/ModuleList.h
lldb/include/lldb/Symbol/SymbolFile.h
lldb/include/lldb/Symbol/SymbolVendor.h
lldb/source/API/SBModule.cpp
lldb/source/API/SBTarget.cpp
lldb/source/Commands/CommandObjectMemory.cpp
lldb/source/Commands/CommandObjectTarget.cpp
lldb/source/Core/Module.cpp
lldb/source/Core/ModuleList.cpp
lldb/source/DataFormatters/TypeFormat.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp
lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
lldb/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
lldb/source/Symbol/SymbolFile.cpp
lldb/source/Symbol/SymbolVendor.cpp
lldb/source/Target/ObjCLanguageRuntime.cpp

index 35b182a..70c10fd 100644 (file)
@@ -27,6 +27,7 @@
 #include "lldb/Symbol/SymbolContextScope.h"
 #include "lldb/Symbol/TypeSystem.h"
 #include "lldb/Target/PathMappingList.h"
+#include "llvm/ADT/DenseSet.h"
 
 namespace lldb_private {
 
@@ -498,6 +499,7 @@ public:
                const ConstString &type_name,
                bool exact_match,
                size_t max_matches,
+               llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
                TypeList& types);
 
     lldb::TypeSP
@@ -1194,6 +1196,7 @@ private:
                     const CompilerDeclContext *parent_decl_ctx,
                     bool append, 
                     size_t max_matches,
+                    llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
                     TypeMap& types);
 
     DISALLOW_COPY_AND_ASSIGN (Module);
index a0dd432..49984c1 100644 (file)
@@ -21,6 +21,7 @@
 #include "lldb/lldb-private.h"
 #include "lldb/Host/Mutex.h"
 #include "lldb/Utility/Iterable.h"
+#include "llvm/ADT/DenseSet.h"
 
 namespace lldb_private {
 
@@ -450,6 +451,7 @@ public:
                const ConstString &name,
                bool name_is_fully_qualified,
                size_t max_matches,
+               llvm::DenseSet<SymbolFile *> &searched_symbol_files,
                TypeList& types) const;
     
     bool
index fe74ad4..b555ecd 100644 (file)
@@ -17,6 +17,8 @@
 #include "lldb/Symbol/CompilerDeclContext.h"
 #include "lldb/Symbol/Type.h"
 
+#include "llvm/ADT/DenseSet.h"
+
 namespace lldb_private {
 
 class SymbolFile :
@@ -141,7 +143,7 @@ public:
     virtual uint32_t        FindGlobalVariables (const RegularExpression& regex, bool append, uint32_t max_matches, VariableList& variables);
     virtual uint32_t        FindFunctions (const ConstString &name, const CompilerDeclContext *parent_decl_ctx, uint32_t name_type_mask, bool include_inlines, bool append, SymbolContextList& sc_list);
     virtual uint32_t        FindFunctions (const RegularExpression& regex, bool include_inlines, bool append, SymbolContextList& sc_list);
-    virtual uint32_t        FindTypes (const SymbolContext& sc, const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, TypeMap& types);
+    virtual uint32_t        FindTypes (const SymbolContext& sc, const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, TypeMap& types);
     virtual size_t          FindTypes (const std::vector<CompilerContext> &context, bool append, TypeMap& types);
 
     virtual void            GetMangledNamesForFunction(const std::string &scope_qualified_name, std::vector<ConstString> &mangled_names);
index 1946171..dbea8c9 100644 (file)
@@ -17,6 +17,7 @@
 #include "lldb/Core/PluginInterface.h"
 #include "lldb/Symbol/TypeList.h"
 #include "lldb/Symbol/TypeMap.h"
+#include "llvm/ADT/DenseSet.h"
 
 namespace lldb_private {
 
@@ -129,6 +130,7 @@ public:
                const CompilerDeclContext *parent_decl_ctx, 
                bool append, 
                size_t max_matches,
+               llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
                TypeMap& types);
 
     virtual size_t
index a810940..bf015f7 100644 (file)
@@ -21,6 +21,7 @@
 #include "lldb/Core/ValueObjectList.h"
 #include "lldb/Core/ValueObjectVariable.h"
 #include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Symbol/SymbolFile.h"
 #include "lldb/Symbol/SymbolVendor.h"
 #include "lldb/Symbol/Symtab.h"
 #include "lldb/Symbol/TypeSystem.h"
@@ -555,10 +556,12 @@ SBModule::FindTypes (const char *type)
         TypeList type_list;
         const bool exact_match = false;
         ConstString name(type);
+        llvm::DenseSet<SymbolFile *> searched_symbol_files;
         const uint32_t num_matches = module_sp->FindTypes (sc,
                                                            name,
                                                            exact_match,
                                                            UINT32_MAX,
+                                                           searched_symbol_files,
                                                            type_list);
         
         if (num_matches > 0)
index a3d4ccc..67c3e42 100644 (file)
@@ -49,6 +49,7 @@
 #include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Symbol/DeclVendor.h"
 #include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Symbol/SymbolFile.h"
 #include "lldb/Symbol/SymbolVendor.h"
 #include "lldb/Symbol/VariableList.h"
 #include "lldb/Target/ABI.h"
@@ -1893,11 +1894,12 @@ SBTarget::FindTypes (const char* typename_cstr)
         bool exact_match = false;
         SymbolContext sc;
         TypeList type_list;
-        
+        llvm::DenseSet<SymbolFile *> searched_symbol_files;
         uint32_t num_matches = images.FindTypes (sc,
                                                  const_typename,
                                                  exact_match,
                                                  UINT32_MAX,
+                                                 searched_symbol_files,
                                                  type_list);
         
         if (num_matches > 0)
index f8fe456..cfb28b2 100644 (file)
@@ -35,6 +35,7 @@
 #include "lldb/Interpreter/OptionValueString.h"
 #include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Symbol/TypeList.h"
+#include "lldb/Symbol/SymbolFile.h"
 #include "lldb/Target/MemoryHistory.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/StackFrame.h"
@@ -514,6 +515,7 @@ protected:
                 }
             }
                     
+            llvm::DenseSet<lldb_private::SymbolFile *> searched_symbol_files;
             ConstString lookup_type_name(type_str.c_str());
             StackFrame *frame = m_exe_ctx.GetFramePtr();
             if (frame)
@@ -524,7 +526,8 @@ protected:
                     sc.module_sp->FindTypes (sc,
                                              lookup_type_name,
                                              exact_match,
-                                             1, 
+                                             1,
+                                             searched_symbol_files,
                                              type_list);
                 }
             }
@@ -533,7 +536,8 @@ protected:
                 target->GetImages().FindTypes (sc, 
                                                lookup_type_name, 
                                                exact_match, 
-                                               1, 
+                                               1,
+                                               searched_symbol_files,
                                                type_list);
             }
 
index 95c03e9..4e86fd9 100644 (file)
@@ -1852,7 +1852,8 @@ LookupTypeInModule (CommandInterpreter &interpreter,
         SymbolContext sc;
 
         ConstString name(name_cstr);
-        num_matches = module->FindTypes(sc, name, name_is_fully_qualified, max_num_matches, type_list);
+        llvm::DenseSet<lldb_private::SymbolFile *> searched_symbol_files;
+        num_matches = module->FindTypes(sc, name, name_is_fully_qualified, max_num_matches, searched_symbol_files, type_list);
 
         if (num_matches)
         {
@@ -1905,7 +1906,8 @@ LookupTypeHere (CommandInterpreter &interpreter,
     bool name_is_fully_qualified = false;
 
     ConstString name(name_cstr);
-    num_matches = sym_ctx.module_sp->FindTypes(sym_ctx, name, name_is_fully_qualified, max_num_matches, type_list);
+    llvm::DenseSet<SymbolFile *> searched_symbol_files;
+    num_matches = sym_ctx.module_sp->FindTypes(sym_ctx, name, name_is_fully_qualified, max_num_matches, searched_symbol_files, type_list);
 
     if (num_matches)
     {
index a29456f..3ada483 100644 (file)
@@ -933,6 +933,7 @@ Module::FindTypes_Impl (const SymbolContext& sc,
                         const CompilerDeclContext *parent_decl_ctx,
                         bool append,
                         size_t max_matches,
+                        llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
                         TypeMap& types)
 {
     Timer scoped_timer(__PRETTY_FUNCTION__, __PRETTY_FUNCTION__);
@@ -940,7 +941,7 @@ Module::FindTypes_Impl (const SymbolContext& sc,
     {
         SymbolVendor *symbols = GetSymbolVendor ();
         if (symbols)
-            return symbols->FindTypes(sc, name, parent_decl_ctx, append, max_matches, types);
+            return symbols->FindTypes(sc, name, parent_decl_ctx, append, max_matches, searched_symbol_files, types);
     }
     return 0;
 }
@@ -954,7 +955,8 @@ Module::FindTypesInNamespace (const SymbolContext& sc,
 {
     const bool append = true;
     TypeMap types_map;
-    size_t num_types = FindTypes_Impl(sc, type_name, parent_decl_ctx, append, max_matches, types_map);
+    llvm::DenseSet<lldb_private::SymbolFile *> searched_symbol_files;
+    size_t num_types = FindTypes_Impl(sc, type_name, parent_decl_ctx, append, max_matches, searched_symbol_files, types_map);
     if (num_types > 0)
         sc.SortTypeList(types_map, type_list);
     return num_types;
@@ -966,7 +968,8 @@ Module::FindFirstType (const SymbolContext& sc,
                        bool exact_match)
 {
     TypeList type_list;
-    const size_t num_matches = FindTypes (sc, name, exact_match, 1, type_list);
+    llvm::DenseSet<lldb_private::SymbolFile *> searched_symbol_files;
+    const size_t num_matches = FindTypes (sc, name, exact_match, 1, searched_symbol_files, type_list);
     if (num_matches)
         return type_list.GetTypeAtIndex(0);
     return TypeSP();
@@ -978,6 +981,7 @@ Module::FindTypes (const SymbolContext& sc,
                    const ConstString &name,
                    bool exact_match,
                    size_t max_matches,
+                   llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
                    TypeList& types)
 {
     size_t num_matches = 0;
@@ -1000,7 +1004,7 @@ Module::FindTypes (const SymbolContext& sc,
             exact_match = true;
         }
         ConstString type_basename_const_str (type_basename.c_str());
-        if (FindTypes_Impl(sc, type_basename_const_str, NULL, append, max_matches, typesmap))
+        if (FindTypes_Impl(sc, type_basename_const_str, NULL, append, max_matches, searched_symbol_files, typesmap))
         {
             typesmap.RemoveMismatchedTypes (type_scope, type_basename, type_class, exact_match);
             num_matches = typesmap.GetSize();
@@ -1013,13 +1017,13 @@ Module::FindTypes (const SymbolContext& sc,
         {
             // The "type_name_cstr" will have been modified if we have a valid type class
             // prefix (like "struct", "class", "union", "typedef" etc).
-            FindTypes_Impl(sc, ConstString(type_name_cstr), NULL, append, max_matches, typesmap);
+            FindTypes_Impl(sc, ConstString(type_name_cstr), NULL, append, max_matches, searched_symbol_files, typesmap);
             typesmap.RemoveMismatchedTypes (type_class);
             num_matches = typesmap.GetSize();
         }
         else
         {
-            num_matches = FindTypes_Impl(sc, name, NULL, append, max_matches, typesmap);
+            num_matches = FindTypes_Impl(sc, name, NULL, append, max_matches, searched_symbol_files, typesmap);
         }
     }
     if (num_matches > 0)
index 75b2ca1..0178cf8 100644 (file)
@@ -23,6 +23,7 @@
 #include "lldb/Host/Host.h"
 #include "lldb/Host/Symbols.h"
 #include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Symbol/SymbolFile.h"
 #include "lldb/Symbol/VariableList.h"
 
 using namespace lldb;
@@ -654,7 +655,7 @@ ModuleList::FindModule (const UUID &uuid) const
 
 
 size_t
-ModuleList::FindTypes (const SymbolContext& sc, const ConstString &name, bool name_is_fully_qualified, size_t max_matches, TypeList& types) const
+ModuleList::FindTypes (const SymbolContext& sc, const ConstString &name, bool name_is_fully_qualified, size_t max_matches, llvm::DenseSet<SymbolFile *> &searched_symbol_files, TypeList& types) const
 {
     Mutex::Locker locker(m_modules_mutex);
 
@@ -668,7 +669,7 @@ ModuleList::FindTypes (const SymbolContext& sc, const ConstString &name, bool na
         {
             if (sc.module_sp.get() == (*pos).get())
             {
-                total_matches += (*pos)->FindTypes (sc, name, name_is_fully_qualified, max_matches, types);
+                total_matches += (*pos)->FindTypes (sc, name, name_is_fully_qualified, max_matches, searched_symbol_files, types);
 
                 if (total_matches >= max_matches)
                     break;
@@ -685,7 +686,7 @@ ModuleList::FindTypes (const SymbolContext& sc, const ConstString &name, bool na
             // context "sc". If "sc" contains a empty module shared pointer, then
             // the comparison will always be true (valid_module_ptr != NULL).
             if (sc.module_sp.get() != (*pos).get())
-                total_matches += (*pos)->FindTypes (world_sc, name, name_is_fully_qualified, max_matches, types);
+                total_matches += (*pos)->FindTypes (world_sc, name, name_is_fully_qualified, max_matches, searched_symbol_files, types);
             
             if (total_matches >= max_matches)
                 break;
index 6ab8d29..a810883 100644 (file)
@@ -23,6 +23,7 @@
 #include "lldb/DataFormatters/FormatManager.h"
 #include "lldb/Symbol/CompilerType.h"
 #include "lldb/Symbol/SymbolContext.h"
+#include "lldb/Symbol/SymbolFile.h"
 #include "lldb/Symbol/TypeList.h"
 #include "lldb/Target/Target.h"
 
@@ -199,7 +200,8 @@ TypeFormatImpl_EnumType::FormatObject (ValueObject *valobj,
         const ModuleList& images(target_sp->GetImages());
         SymbolContext sc;
         TypeList types;
-        images.FindTypes(sc, m_enum_type, false, UINT32_MAX, types);
+        llvm::DenseSet<lldb_private::SymbolFile *> searched_symbol_files;
+        images.FindTypes(sc, m_enum_type, false, UINT32_MAX, searched_symbol_files, types);
         if (types.GetSize() == 0)
             return false;
         for (lldb::TypeSP type_sp : types.Types())
index c158de0..7d8cedf 100644 (file)
@@ -20,6 +20,7 @@
 #include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Symbol/CompilerDeclContext.h"
 #include "lldb/Symbol/Function.h"
+#include "lldb/Symbol/SymbolFile.h"
 #include "lldb/Symbol/SymbolVendor.h"
 #include "lldb/Symbol/TaggedASTType.h"
 #include "lldb/Target/ObjCLanguageRuntime.h"
@@ -299,7 +300,8 @@ ClangASTSource::CompleteType (TagDecl *tag_decl)
             const ModuleList &module_list = m_target->GetImages();
 
             bool exact_match = false;
-            module_list.FindTypes (null_sc, name, exact_match, UINT32_MAX, types);
+            llvm::DenseSet<SymbolFile *> searched_symbol_files;
+            module_list.FindTypes (null_sc, name, exact_match, UINT32_MAX, searched_symbol_files, types);
 
             for (uint32_t ti = 0, te = types.GetSize();
                  ti != te && !found;
@@ -743,11 +745,11 @@ ClangASTSource::FindExternalVisibleDecls (NameSearchContext &context,
         TypeList types;
         SymbolContext null_sc;
         const bool exact_match = false;
-
+        llvm::DenseSet<lldb_private::SymbolFile *> searched_symbol_files;
         if (module_sp && namespace_decl)
             module_sp->FindTypesInNamespace(null_sc, name, &namespace_decl, 1, types);
         else
-            m_target->GetImages().FindTypes(null_sc, name, exact_match, 1, types);
+            m_target->GetImages().FindTypes(null_sc, name, exact_match, 1, searched_symbol_files, types);
 
         bool found_a_type = false;
         
index 3f12a2b..0b074f8 100644 (file)
@@ -40,6 +40,7 @@
 #include "lldb/Expression/ExpressionVariable.h"
 #include "lldb/Symbol/TypeList.h"
 #include "lldb/Symbol/GoASTContext.h"
+#include "lldb/Symbol/SymbolFile.h"
 #include "lldb/Symbol/VariableList.h"
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/Process.h"
@@ -229,7 +230,8 @@ LookupType(TargetSP target, ConstString name)
         return CompilerType();
     SymbolContext sc;
     TypeList type_list;
-    uint32_t num_matches = target->GetImages().FindTypes(sc, name, false, 2, type_list);
+    llvm::DenseSet<SymbolFile *> searched_symbol_files;
+    uint32_t num_matches = target->GetImages().FindTypes(sc, name, false, 2, searched_symbol_files, type_list);
     if (num_matches > 0)
     {
         return type_list.GetTypeAtIndex(0)->GetFullCompilerType();
index bbe716b..983ddf3 100644 (file)
@@ -20,6 +20,7 @@
 #include "lldb/Core/ValueObjectMemory.h"
 #include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Symbol/Symbol.h"
+#include "lldb/Symbol/SymbolFile.h"
 #include "lldb/Symbol/TypeList.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/RegisterContext.h"
@@ -126,12 +127,14 @@ ItaniumABILanguageRuntime::GetDynamicTypeAndAddress (ValueObject &in_value,
                         uint32_t num_matches = 0;
                         // First look in the module that the vtable symbol came from
                         // and look for a single exact match.
+                        llvm::DenseSet<SymbolFile *> searched_symbol_files;
                         if (sc.module_sp)
                         {
                             num_matches = sc.module_sp->FindTypes (sc,
                                                                    ConstString(class_name),
                                                                    exact_match,
                                                                    1,
+                                                                   searched_symbol_files,
                                                                    class_types);
                         }
                         
@@ -144,6 +147,7 @@ ItaniumABILanguageRuntime::GetDynamicTypeAndAddress (ValueObject &in_value,
                                                                          ConstString(class_name),
                                                                          exact_match,
                                                                          UINT32_MAX,
+                                                                         searched_symbol_files,
                                                                          class_types);
                         }
                         
index d59f292..c752971 100644 (file)
@@ -20,6 +20,7 @@
 #include "lldb/Core/ValueObjectMemory.h"
 #include "lldb/Symbol/GoASTContext.h"
 #include "lldb/Symbol/Symbol.h"
+#include "lldb/Symbol/SymbolFile.h"
 #include "lldb/Symbol/TypeList.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/RegisterContext.h"
@@ -117,10 +118,12 @@ LookupRuntimeType(ValueObjectSP type, ExecutionContext* exe_ctx, bool* is_direct
     
     SymbolContext sc;
     TypeList type_list;
+    llvm::DenseSet<SymbolFile *> searched_symbol_files;
     uint32_t num_matches = target->GetImages().FindTypes (sc,
                                                           const_typename,
                                                           false,
                                                           2,
+                                                          searched_symbol_files,
                                                           type_list);
     if (num_matches > 0) {
         return type_list.GetTypeAtIndex(0)->GetFullCompilerType();
index b238364..d09ee06 100644 (file)
@@ -3004,9 +3004,20 @@ SymbolFileDWARF::FindTypes (const SymbolContext& sc,
                             const ConstString &name, 
                             const CompilerDeclContext *parent_decl_ctx, 
                             bool append, 
-                            uint32_t max_matches, 
+                            uint32_t max_matches,
+                            llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
                             TypeMap& types)
 {
+    // If we aren't appending the results to this list, then clear the list
+    if (!append)
+        types.Clear();
+
+    // Make sure we haven't already searched this SymbolFile before...
+    if (searched_symbol_files.count(this))
+        return 0;
+    else
+        searched_symbol_files.insert(this);
+
     DWARFDebugInfo* info = DebugInfo();
     if (info == NULL)
         return 0;
@@ -3029,10 +3040,6 @@ SymbolFileDWARF::FindTypes (const SymbolContext& sc,
                                                       max_matches);
     }
 
-    // If we aren't appending the results to this list, then clear the list
-    if (!append)
-        types.Clear();
-
     if (!DeclContextMatchesThisSymbolFile(parent_decl_ctx))
         return 0;
 
@@ -3130,6 +3137,7 @@ SymbolFileDWARF::FindTypes (const SymbolContext& sc,
                                                                                  parent_decl_ctx,
                                                                                  append,
                                                                                  max_matches,
+                                                                                 searched_symbol_files,
                                                                                  types);
                     if (num_external_matches)
                         return num_external_matches;
index be09759..245354c 100644 (file)
@@ -218,6 +218,7 @@ public:
                const lldb_private::CompilerDeclContext *parent_decl_ctx,
                bool append,
                uint32_t max_matches,
+               llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
                lldb_private::TypeMap& types) override;
 
     size_t
index be25dfc..793c81c 100644 (file)
@@ -1276,7 +1276,8 @@ SymbolFileDWARFDebugMap::FindTypes
     const ConstString &name,
     const CompilerDeclContext *parent_decl_ctx,
     bool append,
-    uint32_t max_matches, 
+    uint32_t max_matches,
+    llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
     TypeMap& types
 )
 {
@@ -1290,12 +1291,12 @@ SymbolFileDWARFDebugMap::FindTypes
     {
         oso_dwarf = GetSymbolFile (sc);
         if (oso_dwarf)
-            return oso_dwarf->FindTypes (sc, name, parent_decl_ctx, append, max_matches, types);
+            return oso_dwarf->FindTypes (sc, name, parent_decl_ctx, append, max_matches, searched_symbol_files, types);
     }
     else
     {
         ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
-            oso_dwarf->FindTypes (sc, name, parent_decl_ctx, append, max_matches, types);
+            oso_dwarf->FindTypes (sc, name, parent_decl_ctx, append, max_matches, searched_symbol_files, types);
             return false;
         });
     }
index 1eb33c9..25a4e19 100644 (file)
@@ -82,7 +82,7 @@ public:
     uint32_t        FindGlobalVariables (const lldb_private::RegularExpression& regex, bool append, uint32_t max_matches, lldb_private::VariableList& variables) override;
     uint32_t        FindFunctions (const lldb_private::ConstString &name, const lldb_private::CompilerDeclContext *parent_decl_ctx, uint32_t name_type_mask, bool include_inlines, bool append, lldb_private::SymbolContextList& sc_list) override;
     uint32_t        FindFunctions (const lldb_private::RegularExpression& regex, bool include_inlines, bool append, lldb_private::SymbolContextList& sc_list) override;
-    uint32_t        FindTypes (const lldb_private::SymbolContext& sc, const lldb_private::ConstString &name, const lldb_private::CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, lldb_private::TypeMap& types) override;
+    uint32_t        FindTypes (const lldb_private::SymbolContext& sc, const lldb_private::ConstString &name, const lldb_private::CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, lldb_private::TypeMap& types) override;
     lldb_private::CompilerDeclContext
                     FindNamespace (const lldb_private::SymbolContext& sc,
                                    const lldb_private::ConstString &name,
index 82bbceb..808dfd3 100644 (file)
@@ -141,7 +141,7 @@ SymbolFile::GetMangledNamesForFunction(const std::string &scope_qualified_name,
 }
 
 uint32_t
-SymbolFile::FindTypes (const SymbolContext& sc, const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, TypeMap& types)
+SymbolFile::FindTypes (const SymbolContext& sc, const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, TypeMap& types)
 {
     if (!append)
         types.Clear();
index b9ec9a1..2666851 100644 (file)
@@ -358,14 +358,14 @@ SymbolVendor::FindFunctions(const RegularExpression& regex, bool include_inlines
 
 
 size_t
-SymbolVendor::FindTypes (const SymbolContext& sc, const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, size_t max_matches, TypeMap& types)
+SymbolVendor::FindTypes (const SymbolContext& sc, const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, size_t max_matches, llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, TypeMap& types)
 {
     ModuleSP module_sp(GetModule());
     if (module_sp)
     {
         lldb_private::Mutex::Locker locker(module_sp->GetMutex());
         if (m_sym_file_ap.get())
-            return m_sym_file_ap->FindTypes(sc, name, parent_decl_ctx, append, max_matches, types);
+            return m_sym_file_ap->FindTypes(sc, name, parent_decl_ctx, append, max_matches, searched_symbol_files, types);
     }
     if (!append)
         types.Clear();
index a18e4c6..8911d9d 100644 (file)
@@ -16,6 +16,7 @@
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Symbol/SymbolContext.h"
+#include "lldb/Symbol/SymbolFile.h"
 #include "lldb/Symbol/Type.h"
 #include "lldb/Symbol/TypeList.h"
 #include "lldb/Target/ObjCLanguageRuntime.h"
@@ -122,11 +123,13 @@ ObjCLanguageRuntime::LookupInCompleteClassCache (ConstString &name)
         const bool exact_match = true;
         const uint32_t max_matches = UINT32_MAX;
         TypeList types;
-        
+
+        llvm::DenseSet<SymbolFile *> searched_symbol_files;
         const uint32_t num_types = module_sp->FindTypes (null_sc,
                                                          name,
                                                          exact_match,
                                                          max_matches,
+                                                         searched_symbol_files,
                                                          types);
         
         if (num_types)