diff options
author | Greg Clayton <gclayton@apple.com> | 2016-02-10 21:28:13 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2016-02-10 21:28:13 +0000 |
commit | ae088e52f315943762023fa90be439864ac54378 (patch) | |
tree | 766f450dc88e7f6700ba209584b96685e75eb961 /lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp | |
parent | a2623c87392e3e741fa5aac1beb81fc58062b949 (diff) | |
download | bcm5719-llvm-ae088e52f315943762023fa90be439864ac54378.tar.gz bcm5719-llvm-ae088e52f315943762023fa90be439864ac54378.zip |
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
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp')
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index be25dfc99de..793c81c021f 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -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; }); } |