From ae088e52f315943762023fa90be439864ac54378 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Wed, 10 Feb 2016 21:28:13 +0000 Subject: Now that SymbolFileDWARF supports having types in completely separate .pcm file with "-fmodules -gmodules", each SymbolFileDWARF can reference module DWARF info by looking in other DWARF files. Then if you have 1000 .o files that each reference one or more .pcm files in their debug info, a simple Module::FindTypes(...) call can end up searching the same .pcm file over and over and over. Now all internal FindTypes methods in classes (ModuleList, Module, SymbolFile) now take an extra argument: llvm::DenseSet &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. llvm-svn: 260434 --- lldb/source/API/SBModule.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lldb/source/API/SBModule.cpp') diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp index a810940f301f..bf015f7f2e58 100644 --- a/lldb/source/API/SBModule.cpp +++ b/lldb/source/API/SBModule.cpp @@ -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 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) -- cgit v1.2.3