[Lldb-commits] [lldb] r141766 - in /lldb/trunk: include/lldb/Core/ source/API/ source/Breakpoint/ source/Commands/ source/Core/ source/Expression/ source/Plugins/ObjectFile/Mach-O/ source/Plugins/OperatingSystem/Darwin-Kernel/ source/Symbol/
Sean Callanan
scallanan at apple.com
Tue Oct 11 19:08:08 PDT 2011
Author: spyffe
Date: Tue Oct 11 21:08:07 2011
New Revision: 141766
URL: http://llvm.org/viewvc/llvm-project?rev=141766&view=rev
Log:
Added ClangNamespaceDecl * parameters to several
core Module functions that the expression parser
will soon be using.
Modified:
lldb/trunk/include/lldb/Core/Module.h
lldb/trunk/source/API/SBModule.cpp
lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp
lldb/trunk/source/Commands/CommandObjectMemory.cpp
lldb/trunk/source/Commands/CommandObjectTarget.cpp
lldb/trunk/source/Core/AddressResolverName.cpp
lldb/trunk/source/Core/Disassembler.cpp
lldb/trunk/source/Core/Module.cpp
lldb/trunk/source/Core/ModuleList.cpp
lldb/trunk/source/Core/SourceManager.cpp
lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/trunk/source/Plugins/OperatingSystem/Darwin-Kernel/OperatingSystemDarwinKernel.cpp
lldb/trunk/source/Symbol/SymbolContext.cpp
Modified: lldb/trunk/include/lldb/Core/Module.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Module.h?rev=141766&r1=141765&r2=141766&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Module.h (original)
+++ lldb/trunk/include/lldb/Core/Module.h Tue Oct 11 21:08:07 2011
@@ -160,7 +160,8 @@
lldb::SymbolType symbol_type = lldb::eSymbolTypeAny);
size_t
- FindSymbolsWithNameAndType (const ConstString &name,
+ FindSymbolsWithNameAndType (const ConstString &name,
+ const ClangNamespaceDecl *namespace_decl,
lldb::SymbolType symbol_type,
SymbolContextList &sc_list);
@@ -207,6 +208,9 @@
/// @param[in] name
/// The name of the compile unit we are looking for.
///
+ /// @param[in] namespace_decl
+ /// If valid, a namespace to search in.
+ ///
/// @param[in] name_type_mask
/// A bit mask of bits that indicate what kind of names should
/// be used when doing the lookup. Bits include fully qualified
@@ -225,7 +229,8 @@
/// The number of matches added to \a sc_list.
//------------------------------------------------------------------
uint32_t
- FindFunctions (const ConstString &name,
+ FindFunctions (const ConstString &name,
+ const ClangNamespaceDecl *namespace_decl,
uint32_t name_type_mask,
bool symbols_ok,
bool append,
@@ -266,6 +271,9 @@
/// The name of the global or static variable we are looking
/// for.
///
+ /// @param[in] namespace_decl
+ /// If valid, a namespace to search in.
+ ///
/// @param[in] append
/// If \b true, any matches will be appended to \a
/// variable_list, else matches replace the contents of
@@ -283,7 +291,8 @@
/// The number of matches added to \a variable_list.
//------------------------------------------------------------------
uint32_t
- FindGlobalVariables (const ConstString &name,
+ FindGlobalVariables (const ConstString &name,
+ const ClangNamespaceDecl *namespace_decl,
bool append,
uint32_t max_matches,
VariableList& variable_list);
@@ -326,6 +335,9 @@
/// @param[in] name
/// The name of the type we are looking for.
///
+ /// @param[in] namespace_decl
+ /// If valid, a namespace to search in.
+ ///
/// @param[in] append
/// If \b true, any matches will be appended to \a
/// variable_list, else matches replace the contents of
@@ -350,8 +362,9 @@
/// The number of matches added to \a type_list.
//------------------------------------------------------------------
uint32_t
- FindTypes (const SymbolContext& sc,
- const ConstString &name,
+ FindTypes (const SymbolContext& sc,
+ const ConstString &name,
+ const ClangNamespaceDecl *namespace_decl,
bool append,
uint32_t max_matches,
TypeList& types);
Modified: lldb/trunk/source/API/SBModule.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBModule.cpp?rev=141766&r1=141765&r2=141766&view=diff
==============================================================================
--- lldb/trunk/source/API/SBModule.cpp (original)
+++ lldb/trunk/source/API/SBModule.cpp Tue Oct 11 21:08:07 2011
@@ -344,7 +344,8 @@
if (m_opaque_sp)
{
const bool symbols_ok = true;
- return m_opaque_sp->FindFunctions (ConstString(name),
+ return m_opaque_sp->FindFunctions (ConstString(name),
+ NULL,
name_type_mask,
symbols_ok,
append,
@@ -361,7 +362,8 @@
if (m_opaque_sp)
{
VariableList variable_list;
- const uint32_t match_count = m_opaque_sp->FindGlobalVariables (ConstString (name),
+ const uint32_t match_count = m_opaque_sp->FindGlobalVariables (ConstString (name),
+ NULL,
false,
max_matches,
variable_list);
@@ -398,6 +400,7 @@
num_matches = m_opaque_sp->FindTypes(sc,
name,
+ NULL,
false,
1,
type_list);
@@ -423,6 +426,7 @@
num_matches = m_opaque_sp->FindTypes(sc,
name,
+ NULL,
false,
UINT32_MAX,
type_list);
Modified: lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp?rev=141766&r1=141765&r2=141766&view=diff
==============================================================================
--- lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp (original)
+++ lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp Tue Oct 11 21:08:07 2011
@@ -16,6 +16,7 @@
#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Core/Log.h"
#include "lldb/Core/StreamString.h"
+#include "lldb/Symbol/ClangNamespaceDecl.h"
#include "lldb/Target/Target.h"
using namespace lldb;
@@ -128,17 +129,18 @@
if (context.module_sp)
{
uint32_t num_functions = context.module_sp->FindFunctions (m_func_name,
- m_func_name_type_mask,
- include_symbols,
- append,
- func_list);
+ NULL,
+ m_func_name_type_mask,
+ include_symbols,
+ append,
+ func_list);
// If the search filter specifies a Compilation Unit, then we don't need to bother to look in plain
// symbols, since all the ones from a set compilation unit will have been found above already.
if (num_functions == 0 && !filter_by_cu)
{
if (m_func_name_type_mask & (eFunctionNameTypeBase | eFunctionNameTypeFull | eFunctionNameTypeAuto))
- context.module_sp->FindSymbolsWithNameAndType (m_func_name, eSymbolTypeCode, sym_list);
+ context.module_sp->FindSymbolsWithNameAndType (m_func_name, NULL, eSymbolTypeCode, sym_list);
}
}
break;
Modified: lldb/trunk/source/Commands/CommandObjectMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMemory.cpp?rev=141766&r1=141765&r2=141766&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectMemory.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectMemory.cpp Tue Oct 11 21:08:07 2011
@@ -25,6 +25,7 @@
#include "lldb/Interpreter/OptionGroupFormat.h"
#include "lldb/Interpreter/OptionGroupOutputFile.h"
#include "lldb/Interpreter/OptionGroupValueObjectDisplay.h"
+#include "lldb/Symbol/ClangNamespaceDecl.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/StackFrame.h"
@@ -447,8 +448,9 @@
sc = frame->GetSymbolContext (eSymbolContextModule);
if (sc.module_sp)
{
- sc.module_sp->FindTypes (sc,
- lookup_type_name,
+ sc.module_sp->FindTypes (sc,
+ lookup_type_name,
+ NULL,
append,
1,
type_list);
Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=141766&r1=141765&r2=141766&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Tue Oct 11 21:08:07 2011
@@ -1498,7 +1498,8 @@
else
{
ConstString function_name (name);
- num_matches = module->FindFunctions (function_name,
+ num_matches = module->FindFunctions (function_name,
+ NULL,
eFunctionNameTypeBase | eFunctionNameTypeFull | eFunctionNameTypeMethod | eFunctionNameTypeSelector,
include_symbols,
append,
@@ -1543,7 +1544,7 @@
// else
// {
ConstString name(name_cstr);
- num_matches = module->FindTypes(sc, name, true, UINT32_MAX, type_list);
+ num_matches = module->FindTypes(sc, name, NULL, true, UINT32_MAX, type_list);
// }
if (num_matches)
Modified: lldb/trunk/source/Core/AddressResolverName.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/AddressResolverName.cpp?rev=141766&r1=141765&r2=141766&view=diff
==============================================================================
--- lldb/trunk/source/Core/AddressResolverName.cpp (original)
+++ lldb/trunk/source/Core/AddressResolverName.cpp Tue Oct 11 21:08:07 2011
@@ -12,6 +12,7 @@
// Project includes
#include "lldb/Core/Log.h"
#include "lldb/Core/StreamString.h"
+#include "lldb/Symbol/ClangNamespaceDecl.h"
#include "lldb/lldb-private-log.h"
using namespace lldb;
@@ -109,10 +110,12 @@
case AddressResolver::Exact:
if (context.module_sp)
{
- context.module_sp->FindSymbolsWithNameAndType (m_func_name,
+ context.module_sp->FindSymbolsWithNameAndType (m_func_name,
+ NULL,
eSymbolTypeCode,
sym_list);
- context.module_sp->FindFunctions (m_func_name,
+ context.module_sp->FindFunctions (m_func_name,
+ NULL,
eFunctionNameTypeBase | eFunctionNameTypeFull | eFunctionNameTypeMethod | eFunctionNameTypeSelector,
include_symbols,
append,
Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=141766&r1=141765&r2=141766&view=diff
==============================================================================
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Tue Oct 11 21:08:07 2011
@@ -24,6 +24,7 @@
#include "lldb/Core/RegularExpression.h"
#include "lldb/Core/Timer.h"
#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Symbol/ClangNamespaceDecl.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/Process.h"
@@ -166,7 +167,8 @@
const bool include_symbols = true;
if (module)
{
- module->FindFunctions (name,
+ module->FindFunctions (name,
+ NULL,
eFunctionNameTypeBase |
eFunctionNameTypeFull |
eFunctionNameTypeMethod |
Modified: lldb/trunk/source/Core/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Module.cpp?rev=141766&r1=141765&r2=141766&view=diff
==============================================================================
--- lldb/trunk/source/Core/Module.cpp (original)
+++ lldb/trunk/source/Core/Module.cpp Tue Oct 11 21:08:07 2011
@@ -350,7 +350,7 @@
uint32_t
-Module::FindGlobalVariables(const ConstString &name, bool append, uint32_t max_matches, VariableList& variables)
+Module::FindGlobalVariables(const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, VariableList& variables)
{
SymbolVendor *symbols = GetSymbolVendor ();
if (symbols)
@@ -389,7 +389,8 @@
}
uint32_t
-Module::FindFunctions (const ConstString &name,
+Module::FindFunctions (const ConstString &name,
+ const ClangNamespaceDecl *namespace_decl,
uint32_t name_type_mask,
bool include_symbols,
bool append,
@@ -509,7 +510,7 @@
}
uint32_t
-Module::FindTypes (const SymbolContext& sc, const ConstString &name, bool append, uint32_t max_matches, TypeList& types)
+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);
@@ -686,7 +687,7 @@
}
size_t
-Module::FindSymbolsWithNameAndType (const ConstString &name, SymbolType symbol_type, SymbolContextList &sc_list)
+Module::FindSymbolsWithNameAndType (const ConstString &name, const ClangNamespaceDecl *namespace_decl, SymbolType symbol_type, SymbolContextList &sc_list)
{
// No need to protect this call using m_mutex all other method calls are
// already thread safe.
Modified: lldb/trunk/source/Core/ModuleList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ModuleList.cpp?rev=141766&r1=141765&r2=141766&view=diff
==============================================================================
--- lldb/trunk/source/Core/ModuleList.cpp (original)
+++ lldb/trunk/source/Core/ModuleList.cpp Tue Oct 11 21:08:07 2011
@@ -16,6 +16,7 @@
#include "lldb/Core/Log.h"
#include "lldb/Core/Module.h"
#include "lldb/Host/Symbols.h"
+#include "lldb/Symbol/ClangNamespaceDecl.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/VariableList.h"
@@ -186,7 +187,7 @@
collection::const_iterator pos, end = m_modules.end();
for (pos = m_modules.begin(); pos != end; ++pos)
{
- (*pos)->FindFunctions (name, name_type_mask, include_symbols, true, sc_list);
+ (*pos)->FindFunctions (name, NULL, name_type_mask, include_symbols, true, sc_list);
}
return sc_list.GetSize();
@@ -221,7 +222,7 @@
collection::iterator pos, end = m_modules.end();
for (pos = m_modules.begin(); pos != end; ++pos)
{
- (*pos)->FindGlobalVariables (name, append, max_matches, variable_list);
+ (*pos)->FindGlobalVariables (name, NULL, append, max_matches, variable_list);
}
return variable_list.GetSize() - initial_size;
}
@@ -253,7 +254,7 @@
sc_list.Clear();
collection::iterator pos, end = m_modules.end();
for (pos = m_modules.begin(); pos != end; ++pos)
- (*pos)->FindSymbolsWithNameAndType (name, symbol_type, sc_list);
+ (*pos)->FindSymbolsWithNameAndType (name, NULL, symbol_type, sc_list);
return sc_list.GetSize();
}
@@ -423,7 +424,7 @@
for (pos = m_modules.begin(); pos != end; ++pos)
{
if (sc.module_sp.get() == NULL || sc.module_sp.get() == (*pos).get())
- total_matches += (*pos)->FindTypes (sc, name, true, max_matches, types);
+ total_matches += (*pos)->FindTypes (sc, name, NULL, true, max_matches, types);
if (total_matches >= max_matches)
break;
Modified: lldb/trunk/source/Core/SourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/SourceManager.cpp?rev=141766&r1=141765&r2=141766&view=diff
==============================================================================
--- lldb/trunk/source/Core/SourceManager.cpp (original)
+++ lldb/trunk/source/Core/SourceManager.cpp Tue Oct 11 21:08:07 2011
@@ -16,6 +16,7 @@
#include "lldb/Core/DataBuffer.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Stream.h"
+#include "lldb/Symbol/ClangNamespaceDecl.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Target/Target.h"
@@ -244,7 +245,7 @@
ConstString main_name("main");
bool symbols_okay = false; // Force it to be a debug symbol.
bool append = false;
- num_matches = executable_ptr->FindFunctions (main_name, lldb::eFunctionNameTypeBase, symbols_okay, append, sc_list);
+ num_matches = executable_ptr->FindFunctions (main_name, NULL, lldb::eFunctionNameTypeBase, symbols_okay, append, sc_list);
for (uint32_t idx = 0; idx < num_matches; idx++)
{
SymbolContext sc;
Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=141766&r1=141765&r2=141766&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Tue Oct 11 21:08:07 2011
@@ -626,7 +626,7 @@
)
{
if (sym_ctx.module_sp)
- sym_ctx.module_sp->FindSymbolsWithNameAndType(name, eSymbolTypeCode, sc_list);
+ sym_ctx.module_sp->FindSymbolsWithNameAndType(name, NULL, eSymbolTypeCode, sc_list);
if (!sc_list.GetSize())
sym_ctx.target_sp->GetImages().FindSymbolsWithNameAndType(name, eSymbolTypeCode, sc_list);
Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=141766&r1=141765&r2=141766&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Tue Oct 11 21:08:07 2011
@@ -22,6 +22,7 @@
#include "lldb/Core/StreamString.h"
#include "lldb/Core/Timer.h"
#include "lldb/Core/UUID.h"
+#include "lldb/Symbol/ClangNamespaceDecl.h"
#include "lldb/Symbol/ObjectFile.h"
@@ -1695,7 +1696,7 @@
SymbolContextList contexts;
SymbolContext context;
- if (!m_module->FindSymbolsWithNameAndType(ConstString ("start"), eSymbolTypeCode, contexts))
+ if (!m_module->FindSymbolsWithNameAndType(ConstString ("start"), NULL, eSymbolTypeCode, contexts))
return m_entry_point_address;
contexts.GetContextAtIndex(0, context);
Modified: lldb/trunk/source/Plugins/OperatingSystem/Darwin-Kernel/OperatingSystemDarwinKernel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/OperatingSystem/Darwin-Kernel/OperatingSystemDarwinKernel.cpp?rev=141766&r1=141765&r2=141766&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/OperatingSystem/Darwin-Kernel/OperatingSystemDarwinKernel.cpp (original)
+++ lldb/trunk/source/Plugins/OperatingSystem/Darwin-Kernel/OperatingSystemDarwinKernel.cpp Tue Oct 11 21:08:07 2011
@@ -19,6 +19,7 @@
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/RegisterValue.h"
#include "lldb/Core/ValueObjectVariable.h"
+#include "lldb/Symbol/ClangNamespaceDecl.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/Process.h"
@@ -131,7 +132,8 @@
Module *exe_module = m_process->GetTarget().GetExecutableModulePointer();
if (exe_module)
{
- if (exe_module->FindGlobalVariables (g_thread_list_name,
+ if (exe_module->FindGlobalVariables (g_thread_list_name,
+ NULL,
append,
max_matches,
variable_list))
Modified: lldb/trunk/source/Symbol/SymbolContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolContext.cpp?rev=141766&r1=141765&r2=141766&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/SymbolContext.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolContext.cpp Tue Oct 11 21:08:07 2011
@@ -479,7 +479,7 @@
}
if (module_sp)
- module_sp->FindFunctions (name, name_type_mask, include_symbols, true, sc_list);
+ module_sp->FindFunctions (name, NULL, name_type_mask, include_symbols, true, sc_list);
if (target_sp)
{
@@ -495,7 +495,7 @@
{
ModuleSP iter_module_sp = modules.GetModuleAtIndex(i);
if (module_sp != iter_module_sp)
- iter_module_sp->FindFunctions (name, name_type_mask, include_symbols, true, sc_list);
+ iter_module_sp->FindFunctions (name, NULL, name_type_mask, include_symbols, true, sc_list);
}
}
}
@@ -516,7 +516,7 @@
TypeList types;
- if (module_sp && module_sp->FindTypes (*this, name, false, 1, types))
+ if (module_sp && module_sp->FindTypes (*this, name, NULL, false, 1, types))
return types.GetTypeAtIndex(0);
SymbolContext sc_for_global_search;
More information about the lldb-commits
mailing list