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)
commitae088e52f315943762023fa90be439864ac54378
tree766f450dc88e7f6700ba209584b96685e75eb961
parenta2623c87392e3e741fa5aac1beb81fc58062b949
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<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