[Lldb-commits] [lldb] r141847 - in /lldb/trunk: include/lldb/Core/ include/lldb/Symbol/ source/Core/ source/Expression/ source/Plugins/SymbolFile/DWARF/ source/Plugins/SymbolFile/Symtab/ source/Symbol/
Sean Callanan
scallanan at apple.com
Wed Oct 12 18:49:11 PDT 2011
Author: spyffe
Date: Wed Oct 12 20:49:10 2011
New Revision: 141847
URL: http://llvm.org/viewvc/llvm-project?rev=141847&view=rev
Log:
Completed the glue that passes a ClangNamespaceDecl *
down through Module and SymbolVendor into SymbolFile.
Added checks to SymbolFileDWARF that restrict symbol
searches when a namespace is passed in.
Modified:
lldb/trunk/include/lldb/Core/Module.h
lldb/trunk/include/lldb/Symbol/SymbolFile.h
lldb/trunk/include/lldb/Symbol/SymbolVendor.h
lldb/trunk/source/Core/Module.cpp
lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
lldb/trunk/source/Symbol/SymbolContext.cpp
lldb/trunk/source/Symbol/SymbolVendor.cpp
Modified: lldb/trunk/include/lldb/Core/Module.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Module.h?rev=141847&r1=141846&r2=141847&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Module.h (original)
+++ lldb/trunk/include/lldb/Core/Module.h Wed Oct 12 20:49:10 2011
@@ -739,7 +739,8 @@
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);
Modified: lldb/trunk/include/lldb/Symbol/SymbolFile.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolFile.h?rev=141847&r1=141846&r2=141847&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/SymbolFile.h (original)
+++ lldb/trunk/include/lldb/Symbol/SymbolFile.h Wed Oct 12 20:49:10 2011
@@ -117,18 +117,19 @@
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; }
Modified: lldb/trunk/include/lldb/Symbol/SymbolVendor.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolVendor.h?rev=141847&r1=141846&r2=141847&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/SymbolVendor.h (original)
+++ lldb/trunk/include/lldb/Symbol/SymbolVendor.h Wed Oct 12 20:49:10 2011
@@ -99,6 +99,7 @@
virtual uint32_t
FindGlobalVariables (const ConstString &name,
+ const ClangNamespaceDecl *namespace_decl,
bool append,
uint32_t max_matches,
VariableList& variables);
@@ -111,6 +112,7 @@
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 @@
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();
Modified: lldb/trunk/source/Core/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Module.cpp?rev=141847&r1=141846&r2=141847&view=diff
==============================================================================
--- lldb/trunk/source/Core/Module.cpp (original)
+++ lldb/trunk/source/Core/Module.cpp Wed Oct 12 20:49:10 2011
@@ -354,7 +354,7 @@
{
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 @@
// 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 @@
}
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 @@
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;
Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=141847&r1=141846&r2=141847&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Wed Oct 12 20:49:10 2011
@@ -2440,7 +2440,7 @@
SymbolContext null_sc;
- namespace_decl = symbol_vendor->FindNamespace(null_sc, name);
+ namespace_decl = symbol_vendor->FindNamespace(null_sc, name, &namespace_decl);
if (namespace_decl)
{
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=141847&r1=141846&r2=141847&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Wed Oct 12 20:49:10 2011
@@ -2008,7 +2008,7 @@
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 @@
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 @@
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 @@
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 @@
// 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 @@
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 @@
{
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
}
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 @@
// 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 @@
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 @@
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 @@
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 @@
{
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 @@
{
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)
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h?rev=141847&r1=141846&r2=141847&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h Wed Oct 12 20:49:10 2011
@@ -107,11 +107,11 @@
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 @@
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);
//------------------------------------------------------------------
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp?rev=141847&r1=141846&r2=141847&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp Wed Oct 12 20:49:10 2011
@@ -702,6 +702,7 @@
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 @@
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 @@
}
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 @@
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 @@
}
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 @@
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 @@
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 @@
{
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 @@
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 @@
{
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 @@
((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;
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h?rev=141847&r1=141846&r2=141847&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h Wed Oct 12 20:49:10 2011
@@ -69,14 +69,15 @@
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 @@
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);
Modified: lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp?rev=141847&r1=141846&r2=141847&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp Wed Oct 12 20:49:10 2011
@@ -280,7 +280,7 @@
}
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 @@
}
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 @@
}
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 @@
}
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();
Modified: lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h?rev=141847&r1=141846&r2=141847&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h Wed Oct 12 20:49:10 2011
@@ -84,26 +84,27 @@
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
Modified: lldb/trunk/source/Symbol/SymbolContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolContext.cpp?rev=141847&r1=141846&r2=141847&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/SymbolContext.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolContext.cpp Wed Oct 12 20:49:10 2011
@@ -457,7 +457,7 @@
{
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;
}
Modified: lldb/trunk/source/Symbol/SymbolVendor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolVendor.cpp?rev=141847&r1=141846&r2=141847&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/SymbolVendor.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolVendor.cpp Wed Oct 12 20:49:10 2011
@@ -216,11 +216,11 @@
}
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 @@
}
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 @@
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;
}
More information about the lldb-commits
mailing list