summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ModuleList.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2016-02-10 21:28:13 +0000
committerGreg Clayton <gclayton@apple.com>2016-02-10 21:28:13 +0000
commitae088e52f315943762023fa90be439864ac54378 (patch)
tree766f450dc88e7f6700ba209584b96685e75eb961 /lldb/source/Core/ModuleList.cpp
parenta2623c87392e3e741fa5aac1beb81fc58062b949 (diff)
downloadbcm5719-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/Core/ModuleList.cpp')
-rw-r--r--lldb/source/Core/ModuleList.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp
index 75b2ca11103..0178cf8ee25 100644
--- a/lldb/source/Core/ModuleList.cpp
+++ b/lldb/source/Core/ModuleList.cpp
@@ -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;
OpenPOWER on IntegriCloud