diff options
-rw-r--r-- | lldb/include/lldb/Core/Module.h | 3 | ||||
-rw-r--r-- | lldb/include/lldb/Symbol/SymbolFile.h | 9 | ||||
-rw-r--r-- | lldb/include/lldb/Symbol/SymbolVendor.h | 8 | ||||
-rw-r--r-- | lldb/source/Core/Module.cpp | 12 | ||||
-rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 53 | ||||
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h | 9 | ||||
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp | 26 | ||||
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h | 10 | ||||
-rw-r--r-- | lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp | 8 | ||||
-rw-r--r-- | lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h | 9 | ||||
-rw-r--r-- | lldb/source/Symbol/SymbolContext.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Symbol/SymbolVendor.cpp | 16 |
13 files changed, 112 insertions, 55 deletions
diff --git a/lldb/include/lldb/Core/Module.h b/lldb/include/lldb/Core/Module.h index b7c5ba9c07a..dc7befa9928 100644 --- a/lldb/include/lldb/Core/Module.h +++ b/lldb/include/lldb/Core/Module.h @@ -739,7 +739,8 @@ private: uint32_t FindTypes_Impl (const SymbolContext& sc, - const ConstString &name, + const ConstString &name, + const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, TypeList& types); diff --git a/lldb/include/lldb/Symbol/SymbolFile.h b/lldb/include/lldb/Symbol/SymbolFile.h index 1e5dec80b55..85b3ce9362a 100644 --- a/lldb/include/lldb/Symbol/SymbolFile.h +++ b/lldb/include/lldb/Symbol/SymbolFile.h @@ -117,18 +117,19 @@ public: virtual clang::DeclContext* GetClangDeclContextContainingTypeUID (lldb::user_id_t type_uid) { return NULL; } virtual uint32_t ResolveSymbolContext (const Address& so_addr, uint32_t resolve_scope, SymbolContext& sc) = 0; virtual uint32_t ResolveSymbolContext (const FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, SymbolContextList& sc_list) = 0; - virtual uint32_t FindGlobalVariables (const ConstString &name, bool append, uint32_t max_matches, VariableList& variables) = 0; + virtual uint32_t FindGlobalVariables (const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, VariableList& variables) = 0; virtual uint32_t FindGlobalVariables (const RegularExpression& regex, bool append, uint32_t max_matches, VariableList& variables) = 0; - virtual uint32_t FindFunctions (const ConstString &name, uint32_t name_type_mask, bool append, SymbolContextList& sc_list) = 0; + virtual uint32_t FindFunctions (const ConstString &name, const ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool append, SymbolContextList& sc_list) = 0; virtual uint32_t FindFunctions (const RegularExpression& regex, bool append, SymbolContextList& sc_list) = 0; - virtual uint32_t FindTypes (const SymbolContext& sc, const ConstString &name, bool append, uint32_t max_matches, TypeList& types) = 0; + virtual uint32_t FindTypes (const SymbolContext& sc, const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, TypeList& types) = 0; // virtual uint32_t FindTypes (const SymbolContext& sc, const RegularExpression& regex, bool append, uint32_t max_matches, TypeList& types) = 0; virtual TypeList * GetTypeList (); virtual ClangASTContext & GetClangASTContext (); virtual ClangNamespaceDecl FindNamespace (const SymbolContext& sc, - const ConstString &name) = 0; + const ConstString &name, + const ClangNamespaceDecl *parent_namespace_decl) = 0; ObjectFile* GetObjectFile() { return m_obj_file; } const ObjectFile* GetObjectFile() const { return m_obj_file; } diff --git a/lldb/include/lldb/Symbol/SymbolVendor.h b/lldb/include/lldb/Symbol/SymbolVendor.h index 19f5a2ff54a..3eec72080b5 100644 --- a/lldb/include/lldb/Symbol/SymbolVendor.h +++ b/lldb/include/lldb/Symbol/SymbolVendor.h @@ -99,6 +99,7 @@ public: virtual uint32_t FindGlobalVariables (const ConstString &name, + const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, VariableList& variables); @@ -111,6 +112,7 @@ public: virtual uint32_t FindFunctions (const ConstString &name, + const ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool append, SymbolContextList& sc_list); @@ -122,14 +124,16 @@ public: virtual uint32_t FindTypes (const SymbolContext& sc, - const ConstString &name, + const ConstString &name, + const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, TypeList& types); virtual lldb_private::ClangNamespaceDecl FindNamespace (const SymbolContext& sc, - const ConstString &name); + const ConstString &name, + const ClangNamespaceDecl *parent_namespace_decl); virtual uint32_t GetNumCompileUnits(); diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index 91395488af8..429362c6ab5 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -354,7 +354,7 @@ Module::FindGlobalVariables(const ConstString &name, const ClangNamespaceDecl *n { SymbolVendor *symbols = GetSymbolVendor (); if (symbols) - return symbols->FindGlobalVariables(name, append, max_matches, variables); + return symbols->FindGlobalVariables(name, namespace_decl, append, max_matches, variables); return 0; } uint32_t @@ -404,7 +404,7 @@ Module::FindFunctions (const ConstString &name, // Find all the functions (not symbols, but debug information functions... SymbolVendor *symbols = GetSymbolVendor (); if (symbols) - symbols->FindFunctions(name, name_type_mask, append, sc_list); + symbols->FindFunctions(name, namespace_decl, name_type_mask, append, sc_list); // Now check our symbol table for symbols that are code symbols if requested if (include_symbols) @@ -477,14 +477,14 @@ Module::FindFunctions (const RegularExpression& regex, } uint32_t -Module::FindTypes_Impl (const SymbolContext& sc, const ConstString &name, bool append, uint32_t max_matches, TypeList& types) +Module::FindTypes_Impl (const SymbolContext& sc, const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, TypeList& types) { Timer scoped_timer(__PRETTY_FUNCTION__, __PRETTY_FUNCTION__); if (sc.module_sp.get() == NULL || sc.module_sp.get() == this) { SymbolVendor *symbols = GetSymbolVendor (); if (symbols) - return symbols->FindTypes(sc, name, append, max_matches, types); + return symbols->FindTypes(sc, name, namespace_decl, append, max_matches, types); } return 0; } @@ -512,12 +512,12 @@ StripTypeName(const char* name_cstr) uint32_t Module::FindTypes (const SymbolContext& sc, const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, TypeList& types) { - uint32_t retval = FindTypes_Impl(sc, name, append, max_matches, types); + uint32_t retval = FindTypes_Impl(sc, name, namespace_decl, append, max_matches, types); if (retval == 0) { const char *stripped = StripTypeName(name.GetCString()); - return FindTypes_Impl(sc, ConstString(stripped), append, max_matches, types); + return FindTypes_Impl(sc, ConstString(stripped), namespace_decl, append, max_matches, types); } else return retval; diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index 81416c26869..44f40d6d4af 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -2440,7 +2440,7 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context, SymbolContext null_sc; - namespace_decl = symbol_vendor->FindNamespace(null_sc, name); + namespace_decl = symbol_vendor->FindNamespace(null_sc, name, &namespace_decl); if (namespace_decl) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 11400b55bcf..bbbbce0862d 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -2008,7 +2008,7 @@ SymbolFileDWARF::DIEIsInNamespace (const ClangNamespaceDecl *namespace_decl, return false; } uint32_t -SymbolFileDWARF::FindGlobalVariables (const ConstString &name, bool append, uint32_t max_matches, VariableList& variables) +SymbolFileDWARF::FindGlobalVariables (const ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, VariableList& variables) { LogSP log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS)); @@ -2019,6 +2019,10 @@ SymbolFileDWARF::FindGlobalVariables (const ConstString &name, bool append, uint m_obj_file->GetFileSpec().GetFilename().GetCString(), name.GetCString(), append, max_matches); } + + if (!NamespaceDeclMatchesThisSymbolFile(namespace_decl)) + return 0; + DWARFDebugInfo* info = DebugInfo(); if (info == NULL) return 0; @@ -2070,6 +2074,9 @@ SymbolFileDWARF::FindGlobalVariables (const ConstString &name, bool append, uint sc.comp_unit = GetCompUnitForDWARFCompUnit(dwarf_cu, UINT32_MAX); assert(sc.comp_unit != NULL); + + if (namespace_decl && !DIEIsInNamespace (namespace_decl, dwarf_cu, die)) + continue; ParseVariables(sc, dwarf_cu, LLDB_INVALID_ADDRESS, die, false, false, &variables); @@ -2343,6 +2350,7 @@ SymbolFileDWARF::FunctionDieMatchesPartialName (const DWARFDebugInfoEntry* die, uint32_t SymbolFileDWARF::FindFunctions (const ConstString &name, + const lldb_private::ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool append, SymbolContextList& sc_list) @@ -2364,6 +2372,9 @@ SymbolFileDWARF::FindFunctions (const ConstString &name, // If we aren't appending the results to this list, then clear the list if (!append) sc_list.Clear(); + + if (!NamespaceDeclMatchesThisSymbolFile(namespace_decl)) + return 0; // If name is empty then we won't find anything. if (name.IsEmpty()) @@ -2442,6 +2453,9 @@ SymbolFileDWARF::FindFunctions (const ConstString &name, const DWARFDebugInfoEntry *die = info->GetDIEPtrWithCompileUnitHint (die_offsets[i], &dwarf_cu); if (die) { + if (namespace_decl && !DIEIsInNamespace (namespace_decl, dwarf_cu, die)) + continue; + ResolveFunction (dwarf_cu, die, sc_list); } } @@ -2450,6 +2464,9 @@ SymbolFileDWARF::FindFunctions (const ConstString &name, { if (effective_name_type_mask & eFunctionNameTypeSelector) { + if (namespace_decl && *namespace_decl) + return 0; // no selectors in namespaces + num_matches = m_apple_names_ap->FindByName (name_cstr, die_offsets); // Now make sure these are actually ObjC methods. In this case we can simply look up the name, // and if it is an ObjC method name, we're good. @@ -2470,6 +2487,10 @@ SymbolFileDWARF::FindFunctions (const ConstString &name, if (effective_name_type_mask & eFunctionNameTypeMethod || effective_name_type_mask & eFunctionNameTypeBase) { + if ((effective_name_type_mask & eFunctionNameTypeMethod) && + (namespace_decl && *namespace_decl)) + return 0; // no methods in namespaces + // The apple_names table stores just the "base name" of C++ methods in the table. So we have to // extract the base name, look that up, and if there is any other information in the name we were // passed in we have to post-filter based on that. @@ -2483,6 +2504,9 @@ SymbolFileDWARF::FindFunctions (const ConstString &name, const DWARFDebugInfoEntry* die = info->GetDIEPtrWithCompileUnitHint (die_offsets[i], &dwarf_cu); if (die) { + if (namespace_decl && !DIEIsInNamespace (namespace_decl, dwarf_cu, die)) + continue; + if (!FunctionDieMatchesPartialName(die, dwarf_cu, effective_name_type_mask, @@ -2522,6 +2546,9 @@ SymbolFileDWARF::FindFunctions (const ConstString &name, const DWARFDebugInfoEntry* die = info->GetDIEPtrWithCompileUnitHint (die_offsets[i], &dwarf_cu); if (die) { + if (namespace_decl && !DIEIsInNamespace (namespace_decl, dwarf_cu, die)) + continue; + if (!FunctionDieMatchesPartialName(die, dwarf_cu, effective_name_type_mask, @@ -2539,6 +2566,9 @@ SymbolFileDWARF::FindFunctions (const ConstString &name, if (effective_name_type_mask & eFunctionNameTypeMethod) { + if (namespace_decl && *namespace_decl) + return 0; // no methods in namespaces + uint32_t num_base = m_function_method_index.Find(base_name_const, die_offsets); { for (uint32_t i = 0; i < num_base; i++) @@ -2562,7 +2592,7 @@ SymbolFileDWARF::FindFunctions (const ConstString &name, die_offsets.clear(); } - if (effective_name_type_mask & eFunctionNameTypeSelector) + if ((effective_name_type_mask & eFunctionNameTypeSelector) && (!namespace_decl || !*namespace_decl)) { FindFunctions (name, m_function_selector_index, sc_list); } @@ -2653,7 +2683,7 @@ SymbolFileDWARF::ReportWarning (const char *format, ...) } uint32_t -SymbolFileDWARF::FindTypes(const SymbolContext& sc, const ConstString &name, bool append, uint32_t max_matches, TypeList& types) +SymbolFileDWARF::FindTypes(const SymbolContext& sc, const ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, TypeList& types) { DWARFDebugInfo* info = DebugInfo(); if (info == NULL) @@ -2672,6 +2702,9 @@ SymbolFileDWARF::FindTypes(const SymbolContext& sc, const ConstString &name, boo // If we aren't appending the results to this list, then clear the list if (!append) types.Clear(); + + if (!NamespaceDeclMatchesThisSymbolFile(namespace_decl)) + return 0; DIEArray die_offsets; @@ -2702,6 +2735,9 @@ SymbolFileDWARF::FindTypes(const SymbolContext& sc, const ConstString &name, boo const dw_offset_t die_offset = die_offsets[i]; die = debug_info->GetDIEPtrWithCompileUnitHint (die_offset, &dwarf_cu); + if (namespace_decl && !DIEIsInNamespace (namespace_decl, dwarf_cu, die)) + continue; + Type *matching_type = ResolveType (dwarf_cu, die); if (matching_type) { @@ -2727,7 +2763,8 @@ SymbolFileDWARF::FindTypes(const SymbolContext& sc, const ConstString &name, boo ClangNamespaceDecl SymbolFileDWARF::FindNamespace (const SymbolContext& sc, - const ConstString &name) + const ConstString &name, + const lldb_private::ClangNamespaceDecl *parent_namespace_decl) { LogSP log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS)); @@ -2738,6 +2775,9 @@ SymbolFileDWARF::FindNamespace (const SymbolContext& sc, m_obj_file->GetFileSpec().GetFilename().GetCString(), name.GetCString()); } + + if (!NamespaceDeclMatchesThisSymbolFile(parent_namespace_decl)) + return ClangNamespaceDecl(); ClangNamespaceDecl namespace_decl; DWARFDebugInfo* info = DebugInfo(); @@ -2770,6 +2810,9 @@ SymbolFileDWARF::FindNamespace (const SymbolContext& sc, { const dw_offset_t die_offset = die_offsets[i]; die = debug_info->GetDIEPtrWithCompileUnitHint (die_offset, &dwarf_cu); + + if (parent_namespace_decl && !DIEIsInNamespace (parent_namespace_decl, dwarf_cu, die)) + continue; clang::NamespaceDecl *clang_namespace_decl = ResolveNamespaceDIE (dwarf_cu, die); if (clang_namespace_decl) @@ -4120,7 +4163,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, { ConstString class_name (class_name_start, class_name_end - class_name_start); TypeList types; - const uint32_t match_count = FindTypes (empty_sc, class_name, true, UINT32_MAX, types); + const uint32_t match_count = FindTypes (empty_sc, class_name, NULL, true, UINT32_MAX, types); if (match_count > 0) { for (uint32_t i=0; i<match_count; ++i) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h index 4a9080c0960..4baf8a9a7e6 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -107,11 +107,11 @@ public: virtual uint32_t ResolveSymbolContext (const lldb_private::Address& so_addr, uint32_t resolve_scope, lldb_private::SymbolContext& sc); virtual uint32_t ResolveSymbolContext (const lldb_private::FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, lldb_private::SymbolContextList& sc_list); - virtual uint32_t FindGlobalVariables(const lldb_private::ConstString &name, bool append, uint32_t max_matches, lldb_private::VariableList& variables); + virtual uint32_t FindGlobalVariables(const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, lldb_private::VariableList& variables); virtual uint32_t FindGlobalVariables(const lldb_private::RegularExpression& regex, bool append, uint32_t max_matches, lldb_private::VariableList& variables); - virtual uint32_t FindFunctions(const lldb_private::ConstString &name, uint32_t name_type_mask, bool append, lldb_private::SymbolContextList& sc_list); + virtual uint32_t FindFunctions(const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool append, lldb_private::SymbolContextList& sc_list); virtual uint32_t FindFunctions(const lldb_private::RegularExpression& regex, bool append, lldb_private::SymbolContextList& sc_list); - virtual uint32_t FindTypes (const lldb_private::SymbolContext& sc, const lldb_private::ConstString &name, bool append, uint32_t max_matches, lldb_private::TypeList& types); + virtual uint32_t FindTypes (const lldb_private::SymbolContext& sc, const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, lldb_private::TypeList& types); virtual lldb_private::TypeList * GetTypeList (); virtual lldb_private::ClangASTContext & @@ -119,7 +119,8 @@ public: virtual lldb_private::ClangNamespaceDecl FindNamespace (const lldb_private::SymbolContext& sc, - const lldb_private::ConstString &name); + const lldb_private::ConstString &name, + const lldb_private::ClangNamespaceDecl *parent_namespace_decl); //------------------------------------------------------------------ diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index 92c6f8f808d..2d702bc57f1 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -702,6 +702,7 @@ uint32_t SymbolFileDWARFDebugMap::PrivateFindGlobalVariables ( const ConstString &name, + const ClangNamespaceDecl *namespace_decl, const std::vector<uint32_t> &indexes, // Indexes into the symbol table that match "name" uint32_t max_matches, VariableList& variables @@ -718,7 +719,7 @@ SymbolFileDWARFDebugMap::PrivateFindGlobalVariables SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex (oso_idx); if (oso_dwarf) { - if (oso_dwarf->FindGlobalVariables(name, true, max_matches, variables)) + if (oso_dwarf->FindGlobalVariables(name, namespace_decl, true, max_matches, variables)) if (variables.GetSize() > max_matches) break; } @@ -728,7 +729,7 @@ SymbolFileDWARFDebugMap::PrivateFindGlobalVariables } uint32_t -SymbolFileDWARFDebugMap::FindGlobalVariables (const ConstString &name, bool append, uint32_t max_matches, VariableList& variables) +SymbolFileDWARFDebugMap::FindGlobalVariables (const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, VariableList& variables) { // If we aren't appending the results to this list, then clear the list @@ -743,7 +744,8 @@ SymbolFileDWARFDebugMap::FindGlobalVariables (const ConstString &name, bool appe SymbolFileDWARF *oso_dwarf; for (uint32_t oso_idx = 0; ((oso_dwarf = GetSymbolFileByOSOIndex (oso_idx)) != NULL); ++oso_idx) { - const uint32_t oso_matches = oso_dwarf->FindGlobalVariables (name, + const uint32_t oso_matches = oso_dwarf->FindGlobalVariables (name, + namespace_decl, true, max_matches, variables); @@ -917,7 +919,7 @@ RemoveFunctionsWithModuleNotEqualTo (Module *module, SymbolContextList &sc_list, } uint32_t -SymbolFileDWARFDebugMap::FindFunctions(const ConstString &name, uint32_t name_type_mask, bool append, SymbolContextList& sc_list) +SymbolFileDWARFDebugMap::FindFunctions(const ConstString &name, const ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool append, SymbolContextList& sc_list) { Timer scoped_timer (__PRETTY_FUNCTION__, "SymbolFileDWARFDebugMap::FindFunctions (name = %s)", @@ -934,7 +936,7 @@ SymbolFileDWARFDebugMap::FindFunctions(const ConstString &name, uint32_t name_ty while ((oso_dwarf = GetSymbolFileByOSOIndex (oso_idx++)) != NULL) { uint32_t sc_idx = sc_list.GetSize(); - if (oso_dwarf->FindFunctions(name, name_type_mask, true, sc_list)) + if (oso_dwarf->FindFunctions(name, namespace_decl, name_type_mask, true, sc_list)) { RemoveFunctionsWithModuleNotEqualTo (m_obj_file->GetModule(), sc_list, sc_idx); } @@ -994,7 +996,8 @@ uint32_t SymbolFileDWARFDebugMap::FindTypes ( const SymbolContext& sc, - const ConstString &name, + const ConstString &name, + const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, TypeList& types @@ -1010,13 +1013,13 @@ SymbolFileDWARFDebugMap::FindTypes { oso_dwarf = GetSymbolFile (sc); if (oso_dwarf) - return oso_dwarf->FindTypes (sc, name, append, max_matches, types); + return oso_dwarf->FindTypes (sc, name, namespace_decl, append, max_matches, types); } else { uint32_t oso_idx = 0; while ((oso_dwarf = GetSymbolFileByOSOIndex (oso_idx++)) != NULL) - oso_dwarf->FindTypes (sc, name, append, max_matches, types); + oso_dwarf->FindTypes (sc, name, namespace_decl, append, max_matches, types); } return types.GetSize() - initial_types_size; @@ -1035,7 +1038,8 @@ SymbolFileDWARFDebugMap::FindTypes ClangNamespaceDecl SymbolFileDWARFDebugMap::FindNamespace (const lldb_private::SymbolContext& sc, - const lldb_private::ConstString &name) + const lldb_private::ConstString &name, + const ClangNamespaceDecl *parent_namespace_decl) { ClangNamespaceDecl matching_namespace; SymbolFileDWARF *oso_dwarf; @@ -1044,7 +1048,7 @@ SymbolFileDWARFDebugMap::FindNamespace (const lldb_private::SymbolContext& sc, { oso_dwarf = GetSymbolFile (sc); if (oso_dwarf) - matching_namespace = oso_dwarf->FindNamespace (sc, name); + matching_namespace = oso_dwarf->FindNamespace (sc, name, parent_namespace_decl); } else { @@ -1052,7 +1056,7 @@ SymbolFileDWARFDebugMap::FindNamespace (const lldb_private::SymbolContext& sc, ((oso_dwarf = GetSymbolFileByOSOIndex (oso_idx)) != NULL); ++oso_idx) { - matching_namespace = oso_dwarf->FindNamespace (sc, name); + matching_namespace = oso_dwarf->FindNamespace (sc, name, parent_namespace_decl); if (matching_namespace) break; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h index 3aa76a36d40..8d722a1a4a8 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h @@ -69,14 +69,15 @@ public: virtual lldb::clang_type_t ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_Type); virtual uint32_t ResolveSymbolContext (const lldb_private::Address& so_addr, uint32_t resolve_scope, lldb_private::SymbolContext& sc); virtual uint32_t ResolveSymbolContext (const lldb_private::FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, lldb_private::SymbolContextList& sc_list); - virtual uint32_t FindGlobalVariables (const lldb_private::ConstString &name, bool append, uint32_t max_matches, lldb_private::VariableList& variables); + virtual uint32_t FindGlobalVariables (const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, lldb_private::VariableList& variables); virtual uint32_t FindGlobalVariables (const lldb_private::RegularExpression& regex, bool append, uint32_t max_matches, lldb_private::VariableList& variables); - virtual uint32_t FindFunctions (const lldb_private::ConstString &name, uint32_t name_type_mask, bool append, lldb_private::SymbolContextList& sc_list); + virtual uint32_t FindFunctions (const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool append, lldb_private::SymbolContextList& sc_list); virtual uint32_t FindFunctions (const lldb_private::RegularExpression& regex, bool append, lldb_private::SymbolContextList& sc_list); - virtual uint32_t FindTypes (const lldb_private::SymbolContext& sc, const lldb_private::ConstString &name, bool append, uint32_t max_matches, lldb_private::TypeList& types); + virtual uint32_t FindTypes (const lldb_private::SymbolContext& sc, const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, lldb_private::TypeList& types); virtual lldb_private::ClangNamespaceDecl FindNamespace (const lldb_private::SymbolContext& sc, - const lldb_private::ConstString &name); + const lldb_private::ConstString &name, + const lldb_private::ClangNamespaceDecl *parent_namespace_decl); //------------------------------------------------------------------ @@ -191,6 +192,7 @@ protected: uint32_t PrivateFindGlobalVariables (const lldb_private::ConstString &name, + const lldb_private::ClangNamespaceDecl *namespace_decl, const std::vector<uint32_t> &name_symbol_indexes, uint32_t max_matches, lldb_private::VariableList& variables); diff --git a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp index 14517e605ee..c3e02d7573f 100644 --- a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp +++ b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp @@ -280,7 +280,7 @@ SymbolFileSymtab::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_Typ } ClangNamespaceDecl -SymbolFileSymtab::FindNamespace (const SymbolContext& sc, const ConstString &name) +SymbolFileSymtab::FindNamespace (const SymbolContext& sc, const ConstString &name, const ClangNamespaceDecl *namespace_decl) { return ClangNamespaceDecl(); } @@ -308,7 +308,7 @@ SymbolFileSymtab::ResolveSymbolContext (const FileSpec& file_spec, uint32_t line } uint32_t -SymbolFileSymtab::FindGlobalVariables(const ConstString &name, bool append, uint32_t max_matches, VariableList& variables) +SymbolFileSymtab::FindGlobalVariables(const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, VariableList& variables) { return 0; } @@ -320,7 +320,7 @@ SymbolFileSymtab::FindGlobalVariables(const RegularExpression& regex, bool appen } uint32_t -SymbolFileSymtab::FindFunctions(const ConstString &name, uint32_t name_type_mask, bool append, SymbolContextList& sc_list) +SymbolFileSymtab::FindFunctions(const ConstString &name, const ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool append, SymbolContextList& sc_list) { Timer scoped_timer (__PRETTY_FUNCTION__, "SymbolFileSymtab::FindFunctions (name = '%s')", @@ -348,7 +348,7 @@ SymbolFileSymtab::FindFunctions(const RegularExpression& regex, bool append, Sym } uint32_t -SymbolFileSymtab::FindTypes (const lldb_private::SymbolContext& sc, const lldb_private::ConstString &name, bool append, uint32_t max_matches, lldb_private::TypeList& types) +SymbolFileSymtab::FindTypes (const lldb_private::SymbolContext& sc, const lldb_private::ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, lldb_private::TypeList& types) { if (!append) types.Clear(); diff --git a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h index f95e0ce24c3..ba43a30424e 100644 --- a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h +++ b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h @@ -84,26 +84,27 @@ public: ResolveSymbolContext (const lldb_private::FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, lldb_private::SymbolContextList& sc_list); virtual uint32_t - FindGlobalVariables(const lldb_private::ConstString &name, bool append, uint32_t max_matches, lldb_private::VariableList& variables); + FindGlobalVariables(const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, lldb_private::VariableList& variables); virtual uint32_t FindGlobalVariables(const lldb_private::RegularExpression& regex, bool append, uint32_t max_matches, lldb_private::VariableList& variables); virtual uint32_t - FindFunctions(const lldb_private::ConstString &name, uint32_t name_type_mask, bool append, lldb_private::SymbolContextList& sc_list); + FindFunctions(const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool append, lldb_private::SymbolContextList& sc_list); virtual uint32_t FindFunctions(const lldb_private::RegularExpression& regex, bool append, lldb_private::SymbolContextList& sc_list); virtual uint32_t - FindTypes (const lldb_private::SymbolContext& sc, const lldb_private::ConstString &name, bool append, uint32_t max_matches, lldb_private::TypeList& types); + FindTypes (const lldb_private::SymbolContext& sc,const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, lldb_private::TypeList& types); // virtual uint32_t // FindTypes(const lldb_private::SymbolContext& sc, const lldb_private::RegularExpression& regex, bool append, uint32_t max_matches, lldb_private::TypeList& types); virtual lldb_private::ClangNamespaceDecl FindNamespace (const lldb_private::SymbolContext& sc, - const lldb_private::ConstString &name); + const lldb_private::ConstString &name, + const lldb_private::ClangNamespaceDecl *parent_namespace_decl); //------------------------------------------------------------------ // PluginInterface protocol diff --git a/lldb/source/Symbol/SymbolContext.cpp b/lldb/source/Symbol/SymbolContext.cpp index 261b1482c86..f571d44d415 100644 --- a/lldb/source/Symbol/SymbolContext.cpp +++ b/lldb/source/Symbol/SymbolContext.cpp @@ -457,7 +457,7 @@ SymbolContext::FindNamespace (const ConstString &name) const { ClangNamespaceDecl namespace_decl; if (module_sp) - namespace_decl = module_sp->GetSymbolVendor()->FindNamespace (*this, name); + namespace_decl = module_sp->GetSymbolVendor()->FindNamespace (*this, name, NULL); return namespace_decl; } diff --git a/lldb/source/Symbol/SymbolVendor.cpp b/lldb/source/Symbol/SymbolVendor.cpp index 4c236400d62..7711923222a 100644 --- a/lldb/source/Symbol/SymbolVendor.cpp +++ b/lldb/source/Symbol/SymbolVendor.cpp @@ -216,11 +216,11 @@ SymbolVendor::ResolveSymbolContext (const FileSpec& file_spec, uint32_t line, bo } uint32_t -SymbolVendor::FindGlobalVariables (const ConstString &name, bool append, uint32_t max_matches, VariableList& variables) +SymbolVendor::FindGlobalVariables (const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, VariableList& variables) { Mutex::Locker locker(m_mutex); if (m_sym_file_ap.get()) - return m_sym_file_ap->FindGlobalVariables(name, append, max_matches, variables); + return m_sym_file_ap->FindGlobalVariables(name, namespace_decl, append, max_matches, variables); return 0; } @@ -234,11 +234,11 @@ SymbolVendor::FindGlobalVariables (const RegularExpression& regex, bool append, } uint32_t -SymbolVendor::FindFunctions(const ConstString &name, uint32_t name_type_mask, bool append, SymbolContextList& sc_list) +SymbolVendor::FindFunctions(const ConstString &name, const ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool append, SymbolContextList& sc_list) { Mutex::Locker locker(m_mutex); if (m_sym_file_ap.get()) - return m_sym_file_ap->FindFunctions(name, name_type_mask, append, sc_list); + return m_sym_file_ap->FindFunctions(name, namespace_decl, name_type_mask, append, sc_list); return 0; } @@ -253,23 +253,23 @@ SymbolVendor::FindFunctions(const RegularExpression& regex, bool append, SymbolC uint32_t -SymbolVendor::FindTypes (const SymbolContext& sc, const ConstString &name, bool append, uint32_t max_matches, TypeList& types) +SymbolVendor::FindTypes (const SymbolContext& sc, const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, TypeList& types) { Mutex::Locker locker(m_mutex); if (m_sym_file_ap.get()) - return m_sym_file_ap->FindTypes(sc, name, append, max_matches, types); + return m_sym_file_ap->FindTypes(sc, name, namespace_decl, append, max_matches, types); if (!append) types.Clear(); return 0; } ClangNamespaceDecl -SymbolVendor::FindNamespace(const SymbolContext& sc, const ConstString &name) +SymbolVendor::FindNamespace(const SymbolContext& sc, const ConstString &name, const ClangNamespaceDecl *parent_namespace_decl) { Mutex::Locker locker(m_mutex); ClangNamespaceDecl namespace_decl; if (m_sym_file_ap.get()) - namespace_decl = m_sym_file_ap->FindNamespace (sc, name); + namespace_decl = m_sym_file_ap->FindNamespace (sc, name, parent_namespace_decl); return namespace_decl; } |