summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Module.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2017-04-28 00:51:06 +0000
committerJim Ingham <jingham@apple.com>2017-04-28 00:51:06 +0000
commit7fca8c0757a5ee5f290844376c7f8c5f3c1ffcfe (patch)
tree8ffa218d59b3457f715da90aa94da0d32c87cd15 /lldb/source/Core/Module.cpp
parentb242e93541f2332cd89ea7a919eec1ade7b57dc7 (diff)
downloadbcm5719-llvm-7fca8c0757a5ee5f290844376c7f8c5f3c1ffcfe.tar.gz
bcm5719-llvm-7fca8c0757a5ee5f290844376c7f8c5f3c1ffcfe.zip
Provide a mechanism to do some pre-loading of symbols up front.
Loading a shared library can require a large amount of work; rather than do that serially for each library, this patch will allow parallelization of the symbols and debug info name indexes. From scott.smith@purestorage.com https://reviews.llvm.org/D32598 llvm-svn: 301609
Diffstat (limited to 'lldb/source/Core/Module.cpp')
-rw-r--r--lldb/source/Core/Module.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index ddc9fca8067..d168474c347 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -1432,6 +1432,22 @@ size_t Module::FindSymbolsMatchingRegExAndType(const RegularExpression &regex,
return sc_list.GetSize() - initial_size;
}
+void Module::PreloadSymbols() {
+ std::lock_guard<std::recursive_mutex> guard(m_mutex);
+ SymbolVendor * sym_vendor = GetSymbolVendor();
+ if (!sym_vendor) {
+ return;
+ }
+ // Prime the symbol file first, since it adds symbols to the symbol table.
+ if (SymbolFile *symbol_file = sym_vendor->GetSymbolFile()) {
+ symbol_file->PreloadSymbols();
+ }
+ // Now we can prime the symbol table.
+ if (Symtab * symtab = sym_vendor->GetSymtab()) {
+ symtab->PreloadSymbols();
+ }
+}
+
void Module::SetSymbolFileFileSpec(const FileSpec &file) {
if (!file.Exists())
return;
OpenPOWER on IntegriCloud