From ae088e52f315943762023fa90be439864ac54378 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Wed, 10 Feb 2016 21:28:13 +0000 Subject: 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 &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. llvm-svn: 260434 --- lldb/source/Commands/CommandObjectTarget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lldb/source/Commands/CommandObjectTarget.cpp') diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index 95c03e92..4e86fd9 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -1852,7 +1852,8 @@ LookupTypeInModule (CommandInterpreter &interpreter, SymbolContext sc; ConstString name(name_cstr); - num_matches = module->FindTypes(sc, name, name_is_fully_qualified, max_num_matches, type_list); + llvm::DenseSet searched_symbol_files; + num_matches = module->FindTypes(sc, name, name_is_fully_qualified, max_num_matches, searched_symbol_files, type_list); if (num_matches) { @@ -1905,7 +1906,8 @@ LookupTypeHere (CommandInterpreter &interpreter, bool name_is_fully_qualified = false; ConstString name(name_cstr); - num_matches = sym_ctx.module_sp->FindTypes(sym_ctx, name, name_is_fully_qualified, max_num_matches, type_list); + llvm::DenseSet searched_symbol_files; + num_matches = sym_ctx.module_sp->FindTypes(sym_ctx, name, name_is_fully_qualified, max_num_matches, searched_symbol_files, type_list); if (num_matches) { -- cgit v1.1