diff options
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r-- | lldb/source/Commands/CommandCompletions.cpp | 27 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectImage.cpp | 51 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectSource.cpp | 5 |
3 files changed, 38 insertions, 45 deletions
diff --git a/lldb/source/Commands/CommandCompletions.cpp b/lldb/source/Commands/CommandCompletions.cpp index 8a1cd5adfc5..3102f558488 100644 --- a/lldb/source/Commands/CommandCompletions.cpp +++ b/lldb/source/Commands/CommandCompletions.cpp @@ -599,35 +599,24 @@ CommandCompletions::SymbolCompleter::SearchCallback ( bool complete ) { - SymbolContextList func_list; - SymbolContextList sym_list; - - if (context.module_sp != NULL) + if (context.module_sp) { - if (context.module_sp) - { - context.module_sp->FindSymbolsMatchingRegExAndType (m_regex, lldb::eSymbolTypeCode, sym_list); - context.module_sp->FindFunctions (m_regex, true, func_list); - } + SymbolContextList sc_list; + const bool include_symbols = true; + const bool append = true; + context.module_sp->FindFunctions (m_regex, include_symbols, append, sc_list); SymbolContext sc; // Now add the functions & symbols to the list - only add if unique: - for (uint32_t i = 0; i < func_list.GetSize(); i++) + for (uint32_t i = 0; i < sc_list.GetSize(); i++) { - if (func_list.GetContextAtIndex(i, sc)) + if (sc_list.GetContextAtIndex(i, sc)) { if (sc.function) { m_match_set.insert (sc.function->GetMangled().GetDemangledName()); } - } - } - - for (uint32_t i = 0; i < sym_list.GetSize(); i++) - { - if (sym_list.GetContextAtIndex(i, sc)) - { - if (sc.symbol && sc.symbol->GetAddressRangePtr()) + else if (sc.symbol && sc.symbol->GetAddressRangePtr()) { m_match_set.insert (sc.symbol->GetMangled().GetDemangledName()); } diff --git a/lldb/source/Commands/CommandObjectImage.cpp b/lldb/source/Commands/CommandObjectImage.cpp index 58907bfd2d1..1f6cd50941d 100644 --- a/lldb/source/Commands/CommandObjectImage.cpp +++ b/lldb/source/Commands/CommandObjectImage.cpp @@ -360,33 +360,36 @@ LookupFunctionInModule (CommandInterpreter &interpreter, Stream &strm, Module *m if (module && name && name[0]) { SymbolContextList sc_list; - - SymbolVendor *symbol_vendor = module->GetSymbolVendor(); - if (symbol_vendor) + const bool include_symbols = false; + const bool append = true; + uint32_t num_matches = 0; + if (name_is_regex) { - uint32_t num_matches = 0; - if (name_is_regex) - { - RegularExpression function_name_regex (name); - num_matches = symbol_vendor->FindFunctions(function_name_regex, true, sc_list); - - } - else - { - ConstString function_name(name); - num_matches = symbol_vendor->FindFunctions(function_name, eFunctionNameTypeBase | eFunctionNameTypeFull | eFunctionNameTypeMethod | eFunctionNameTypeSelector, true, sc_list); - } + RegularExpression function_name_regex (name); + num_matches = module->FindFunctions (function_name_regex, + include_symbols, + append, + sc_list); + } + else + { + ConstString function_name (name); + num_matches = module->FindFunctions (function_name, + eFunctionNameTypeBase | eFunctionNameTypeFull | eFunctionNameTypeMethod | eFunctionNameTypeSelector, + include_symbols, + append, + sc_list); + } - if (num_matches) - { - strm.Indent (); - strm.Printf("%u match%s found in ", num_matches, num_matches > 1 ? "es" : ""); - DumpFullpath (strm, &module->GetFileSpec(), 0); - strm.PutCString(":\n"); - DumpSymbolContextList (interpreter, strm, sc_list, true); - } - return num_matches; + if (num_matches) + { + strm.Indent (); + strm.Printf("%u match%s found in ", num_matches, num_matches > 1 ? "es" : ""); + DumpFullpath (strm, &module->GetFileSpec(), 0); + strm.PutCString(":\n"); + DumpSymbolContextList (interpreter, strm, sc_list, true); } + return num_matches; } return 0; } diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp index 88c18be5551..65983d78029 100644 --- a/lldb/source/Commands/CommandObjectSource.cpp +++ b/lldb/source/Commands/CommandObjectSource.cpp @@ -289,6 +289,7 @@ public: SymbolContextList sc_list; ConstString name(m_options.symbol_name.c_str()); + bool include_symbols = false; bool append = true; size_t num_matches = 0; @@ -302,13 +303,13 @@ public: { matching_modules.Clear(); target->GetImages().FindModules (&module_spec, NULL, NULL, NULL, matching_modules); - num_matches += matching_modules.FindFunctions (name, eFunctionNameTypeBase, append, sc_list); + num_matches += matching_modules.FindFunctions (name, eFunctionNameTypeBase, include_symbols, append, sc_list); } } } else { - num_matches = target->GetImages().FindFunctions (name, eFunctionNameTypeBase, append, sc_list); + num_matches = target->GetImages().FindFunctions (name, eFunctionNameTypeBase, include_symbols, append, sc_list); } SymbolContext sc; |