[Lldb-commits] [lldb] r141468 - in /lldb/trunk: include/lldb/Symbol/SymbolContext.h source/Expression/ClangExpressionDeclMap.cpp source/Symbol/SymbolContext.cpp test/expression_command/formatters/TestFormatters.py
Jim Ingham
jingham at apple.com
Fri Oct 7 18:11:42 PDT 2011
Author: jingham
Date: Fri Oct 7 20:11:42 2011
New Revision: 141468
URL: http://llvm.org/viewvc/llvm-project?rev=141468&view=rev
Log:
Fix the last testsuite regression from the apple-names stuff.
Modified:
lldb/trunk/include/lldb/Symbol/SymbolContext.h
lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
lldb/trunk/source/Symbol/SymbolContext.cpp
lldb/trunk/test/expression_command/formatters/TestFormatters.py
Modified: lldb/trunk/include/lldb/Symbol/SymbolContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolContext.h?rev=141468&r1=141467&r2=141468&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/SymbolContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/SymbolContext.h Fri Oct 7 20:11:42 2011
@@ -229,8 +229,9 @@
/// The number of symbol contexts found.
//------------------------------------------------------------------
size_t
- FindFunctionsByName (const ConstString &name,
- bool include_symbols,
+ FindFunctionsByName (const ConstString &name,
+ uint32_t name_type_mask,
+ bool include_symbols,
bool append,
SymbolContextList &sc_list) const;
Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=141468&r1=141467&r2=141468&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Fri Oct 7 20:11:42 2011
@@ -2182,7 +2182,8 @@
{
const bool include_symbols = true;
const bool append = false;
- m_parser_vars->m_sym_ctx.FindFunctionsByName (name,
+ m_parser_vars->m_sym_ctx.FindFunctionsByName (name,
+ eFunctionNameTypeBase,
include_symbols,
append,
sc_list);
Modified: lldb/trunk/source/Symbol/SymbolContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolContext.cpp?rev=141468&r1=141467&r2=141468&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/SymbolContext.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolContext.cpp Fri Oct 7 20:11:42 2011
@@ -463,12 +463,14 @@
size_t
SymbolContext::FindFunctionsByName (const ConstString &name,
+ uint32_t name_type_mask,
bool include_symbols,
bool append,
SymbolContextList &sc_list) const
{
if (!append)
sc_list.Clear();
+ uint32_t old_size = sc_list.GetSize();
if (function != NULL)
{
@@ -477,12 +479,27 @@
}
if (module_sp)
- module_sp->FindFunctions (name, eFunctionNameTypeBase | eFunctionNameTypeFull, include_symbols, true, sc_list);
+ module_sp->FindFunctions (name, name_type_mask, include_symbols, true, sc_list);
if (target_sp)
- target_sp->GetImages().FindFunctions (name, eFunctionNameTypeBase | eFunctionNameTypeFull, include_symbols, true, sc_list);
-
- return sc_list.GetSize();
+ {
+ if (!module_sp)
+ {
+ target_sp->GetImages().FindFunctions (name, name_type_mask, include_symbols, true, sc_list);
+ }
+ else
+ {
+ ModuleList &modules = target_sp->GetImages();
+ uint32_t num_modules = modules.GetSize();
+ for (uint32_t i = 0; i < num_modules; i++)
+ {
+ 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);
+ }
+ }
+ }
+ return sc_list.GetSize() - old_size;
}
//lldb::VariableSP
Modified: lldb/trunk/test/expression_command/formatters/TestFormatters.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/formatters/TestFormatters.py?rev=141468&r1=141467&r2=141468&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/formatters/TestFormatters.py (original)
+++ lldb/trunk/test/expression_command/formatters/TestFormatters.py Fri Oct 7 20:11:42 2011
@@ -56,29 +56,29 @@
self.runCmd("frame variable foo1.b -T")
self.runCmd("frame variable foo1.b.b_ref -T")
- self.expect("p *(new foo(47))",
+ self.expect("expression *(new foo(47))",
substrs = ['(int) a = 47', '(bar) b = {', '(int) i = 94', '(baz) b = {', '(int) k = 99'])
self.runCmd("type summary add -F formatters.foo_SummaryProvider foo")
- self.expect("p new int(12)",
+ self.expect("expression new int(12)",
substrs = ['(int *) $', ' = 0x'])
self.runCmd("type summary add -s \"${var%pointer} -> ${*var%decimal}\" \"int *\"")
- self.expect("p new int(12)",
+ self.expect("expression new int(12)",
substrs = ['(int *) $', '= 0x', ' -> 12'])
- self.expect("p foo1.a_ptr",
+ self.expect("expression foo1.a_ptr",
substrs = ['(int *) $', '= 0x', ' -> 13'])
- self.expect("p foo1",
+ self.expect("expression foo1",
substrs = ['(foo) $', ' = a = 12, a_ptr = ', ' -> 13, i = 24, i_ptr = ', ' -> 25'])
- self.expect("p new foo(47)",
+ self.expect("expression new foo(47)",
substrs = ['(foo *) $', ' a = 47, a_ptr = ', ' -> 48, i = 94, i_ptr = ', ' -> 95'])
- self.expect("p foo2",
+ self.expect("expression foo2",
substrs = ['(foo) $', ' = a = 121, a_ptr = ', ' -> 122, i = 242, i_ptr = ', ' -> 243'])
object_name = self.res.GetOutput()
@@ -88,13 +88,13 @@
self.expect("frame variable foo2",
substrs = ['(foo)', 'foo2', ' = a = 121, a_ptr = ', ' -> 122, i = 242, i_ptr = ', ' -> 243'])
- self.expect("p $" + object_name,
+ self.expect("expression $" + object_name,
substrs = ['(foo) $', ' = a = 121, a_ptr = ', ' -> 122, i = 242, i_ptr = ', ' -> 243', ', h = 245 , k = 247'])
self.runCmd("type summary delete foo")
self.runCmd("type synthetic add --python-class foosynth.FooSyntheticProvider foo")
- self.expect("p $" + object_name,
+ self.expect("expression $" + object_name,
substrs = ['(foo) $', ' = {', '(int) *i_ptr = 243'])
self.runCmd("n")
@@ -103,22 +103,22 @@
self.runCmd("type synthetic delete foo")
self.runCmd("type summary add -F formatters.foo_SummaryProvider foo")
- self.expect("p foo2",
+ self.expect("expression foo2",
substrs = ['(foo) $', ' = a = 7777, a_ptr = ', ' -> 122, i = 242, i_ptr = ', ' -> 8888'])
- self.expect("p $" + object_name + '.a',
+ self.expect("expression $" + object_name + '.a',
substrs = ['7777'])
- self.expect("p *$" + object_name + '.b.i_ptr',
+ self.expect("expression *$" + object_name + '.b.i_ptr',
substrs = ['8888'])
- self.expect("p $" + object_name,
+ self.expect("expression $" + object_name,
substrs = ['(foo) $', ' = a = 121, a_ptr = ', ' -> 122, i = 242, i_ptr = ', ' -> 8888', 'h = 245 , k = 247'])
self.runCmd("type summary delete foo")
self.runCmd("type synthetic add --python-class foosynth.FooSyntheticProvider foo")
- self.expect("p $" + object_name,
+ self.expect("expression $" + object_name,
substrs = ['(foo) $', ' = {', '(int) *i_ptr = 8888'])
self.runCmd("n")
@@ -126,7 +126,7 @@
self.runCmd("type synthetic delete foo")
self.runCmd("type summary add -F formatters.foo_SummaryProvider foo")
- self.expect("p $" + object_name,
+ self.expect("expression $" + object_name,
substrs = ['(foo) $', ' = a = 121, a_ptr = ', ' -> 122, i = 242, i_ptr = ', ' -> 8888', 'h = 9999 , k = 247'])
process = self.dbg.GetSelectedTarget().GetProcess()
@@ -145,7 +145,7 @@
self.expect("frame variable numbers",
substrs = ['1','2','3','4','5'])
- self.expect("p numbers",
+ self.expect("expression numbers",
substrs = ['1','2','3','4','5'])
frozen = frame.EvaluateExpression("&numbers")
More information about the lldb-commits
mailing list