summaryrefslogtreecommitdiffstats
path: root/lldb/source/Symbol/SymbolFile.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-04-26 16:53:42 +0000
committerGreg Clayton <gclayton@apple.com>2012-04-26 16:53:42 +0000
commit9efa076aa66dce7a218322dd6d73def942cbe100 (patch)
tree131f1798b38e1c21d6c695f47a642eca12ae9097 /lldb/source/Symbol/SymbolFile.cpp
parent11b1f4166283812b27e19cb2a726c13b914ec9fc (diff)
downloadbcm5719-llvm-9efa076aa66dce7a218322dd6d73def942cbe100.tar.gz
bcm5719-llvm-9efa076aa66dce7a218322dd6d73def942cbe100.zip
Save more memory by not parsing the symbol table for stand alone DWARF files. We currently have SymbolFile plug-ins which all get the chance to say what they can parse in a symbol file. Prior to this fix we would ask the SymbolFileDWARF plug-in what abilities it had, and it would answer with "everything", and then we would check the SymbolFileSymtab plug-in what abilities it had, in case it had more abilities. The checking that SymbolFileSymtab does is a bit expensive as it pulls in the entire symbol table just to see if it can offer a few scraps of debug information. This causes all stand along DWARF files to pull in their symbol tables even though those symbols will never be used. This fix will check all SymbolFile plug-ins for their abilities and if any plug-in responds with "everything", then we stop the search.
llvm-svn: 155638
Diffstat (limited to 'lldb/source/Symbol/SymbolFile.cpp')
-rw-r--r--lldb/source/Symbol/SymbolFile.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lldb/source/Symbol/SymbolFile.cpp b/lldb/source/Symbol/SymbolFile.cpp
index 92af5f25540..808830e1f15 100644
--- a/lldb/source/Symbol/SymbolFile.cpp
+++ b/lldb/source/Symbol/SymbolFile.cpp
@@ -27,9 +27,6 @@ SymbolFile::FindPlugin (ObjectFile* obj_file)
// TODO: Load any plug-ins in the appropriate plug-in search paths and
// iterate over all of them to find the best one for the job.
- //----------------------------------------------------------------------
- // We currently only have one debug symbol parser...
- //----------------------------------------------------------------------
uint32_t best_symfile_abilities = 0;
SymbolFileCreateInstance create_callback;
@@ -39,11 +36,15 @@ SymbolFile::FindPlugin (ObjectFile* obj_file)
if (curr_symfile_ap.get())
{
- uint32_t sym_file_abilities = curr_symfile_ap->GetAbilities();
+ const uint32_t sym_file_abilities = curr_symfile_ap->GetAbilities();
if (sym_file_abilities > best_symfile_abilities)
{
best_symfile_abilities = sym_file_abilities;
best_symfile_ap = curr_symfile_ap;
+ // If any symbol file parser has all of the abilities, then
+ // we should just stop looking.
+ if ((kAllAbilities & sym_file_abilities) == kAllAbilities)
+ break;
}
}
}
OpenPOWER on IntegriCloud