lldbutil.run_to_source_breakpoint(self, '// break here',
lldb.SBFileSpec("main.cpp"))
- self.expect("expr returnPassByRef()",
- substrs=['(PassByRef)', '= 11223344'])
+ self.expect_expr("returnPassByRef()", result_type="PassByRef", result_children=[
+ ValueCheck(name="x", value="11223344")
+ ])
- self.expect("expr takePassByRef(p)",
- substrs=['(int)', '= 42'])
+ self.expect_expr("takePassByRef(p)", result_type="int", result_value="42")
lldbutil.run_to_source_breakpoint(self, '// break here',
lldb.SBFileSpec("main.cpp", False))
- self.expect("expr (flow_e)0", substrs=['(flow_e) $0 = A'])
+ self.expect_expr("(flow_e)0", result_type="flow_e", result_value="A")
thread = process.GetSelectedThread()
# try evaluating a couple of expressions in this state
- self.expect("expr release_flag = 1", substrs=[" = 1"])
- self.expect("print (int)getpid()",
- substrs=[str(process.GetProcessID())])
+ self.expect_expr("release_flag = 1", result_value="1")
+ self.expect_expr("(int)getpid()", result_value=str(process.GetProcessID()))
# and run the process to completion
process.Continue()
(self.target, self.process, _, bkpt) = lldbutil.run_to_source_breakpoint(self, '// break here',
lldb.SBFileSpec("main.cpp", False))
- self.expect("expr p0",
- substrs=['(VType) $0 = {}'])
+ self.expect_expr("p0", result_type="VType", result_children=[])
int main() {
Foo f;
// Try to construct foo in our expression.
- return 0; //%self.expect("expr Foo()", substrs=["(Foo) $0 = {}"])
+ return 0; //%self.expect_expr("Foo()", result_type="Foo", result_children=[])
}
self.runToBkpt("run")
# Evaluate ns1::value
- self.expect("expression -- value", startstr="(int) $0 = 100")
+ self.expect_expr("value", result_value="100")
self.runToBkpt("continue")
# Evaluate ns2::value
- self.expect("expression -- value", startstr="(int) $1 = 200")
+ self.expect_expr("value", result_value="200")
self.runToBkpt("continue")
# On Mac OS X, gcc 4.2 emits the wrong debug info with respect to
# rdar://problem/8660275
# test/namespace: 'expression -- i+j' not working
# This has been fixed.
- self.expect("expression -- i + j",
- startstr="(int) $2 = 7")
+ self.expect_expr("i + j", result_type="int", result_value="7")
# (int) $2 = 7
- self.runCmd("expression -- i")
- self.runCmd("expression -- j")
+ self.expect_expr("i", result_value="3")
+ self.expect_expr("j", result_value="4")
# rdar://problem/8668674
# expression command with fully qualified namespace for a variable does
# not work
- self.expect("expression -- ::i", VARIABLES_DISPLAYED_CORRECTLY,
- patterns=[' = 3'])
- self.expect("expression -- A::B::j", VARIABLES_DISPLAYED_CORRECTLY,
- patterns=[' = 4'])
+ self.expect_expr("::i", result_value="3")
+ self.expect_expr("A::B::j", result_value="4")
# expression command with function in anonymous namespace
- self.expect("expression -- myanonfunc(3)",
- patterns=[' = 6'])
+ self.expect_expr("myanonfunc(3)", result_value="6")
# global namespace qualification with function in anonymous namespace
- self.expect("expression -- ::myanonfunc(4)",
- patterns=[' = 8'])
+ self.expect_expr("myanonfunc(4)", result_value="8")
self.expect("p myanonfunc",
patterns=['\(anonymous namespace\)::myanonfunc\(int\)'])
-(int) entryPoint
{
// Try calling directly with self. Same as in the main method otherwise.
- return 0; //%self.expect("expr [self directCallNoArgs]", substrs=["called directCallNoArgs"])
- //%self.expect("expr [self directCallArgs: 1111]", substrs=["= 2345"])
- //%self.expect("expr side_effect = 0; [self directCallVoidReturn]; side_effect", substrs=["= 4321"])
- //%self.expect("expr [self directCallNSStringArg: str]", substrs=['@"some string"'])
- //%self.expect("expr [self directCallIdArg: (id)str]", substrs=['@"some string appendix"'])
- //%self.expect("expr [self directCallConflictingName]", substrs=["correct function"])
- //%self.expect("expr [self directCallWithCategory]", substrs=["called function with category"])
+ return 0; //%self.expect_expr("[self directCallNoArgs]", result_summary='"called directCallNoArgs"')
+ //%self.expect_expr("[self directCallArgs: 1111]", result_value="2345")
+ //%self.expect_expr("side_effect = 0; [self directCallVoidReturn]; side_effect", result_value="4321")
+ //%self.expect_expr("[self directCallNSStringArg: str]", result_summary='@"some string"')
+ //%self.expect_expr("[self directCallIdArg: (id)str]", result_summary='@"some string appendix"')
+ //%self.expect_expr("[self directCallConflictingName]", result_summary='"correct function"')
+ //%self.expect_expr("[self directCallWithCategory]", result_summary='"called function with category"')
}
// Declare several objc_direct functions we can test.
[foo directCallVoidReturn];
[foo directCallNSStringArg: str];
[foo directCallIdArg: (id)str];
- [foo entryPoint]; //%self.expect("expr [foo directCallNoArgs]", substrs=["called directCallNoArgs"])
- //%self.expect("expr [foo directCallArgs: 1111]", substrs=["= 2345"])
- //%self.expect("expr side_effect = 0; [foo directCallVoidReturn]; side_effect", substrs=["= 4321"])
- //%self.expect("expr [foo directCallNSStringArg: str]", substrs=['@"some string"'])
- //%self.expect("expr [foo directCallIdArg: (id)str]", substrs=['@"some string appendix"'])
- //%self.expect("expr [foo directCallConflictingName]", substrs=["correct function"])
- //%self.expect("expr [foo directCallWithCategory]", substrs=["called function with category"])
+ [foo entryPoint]; //%self.expect_expr("[foo directCallNoArgs]", result_summary='"called directCallNoArgs"')
+ //%self.expect_expr("[foo directCallArgs: 1111]", result_value="2345")
+ //%self.expect_expr("side_effect = 0; [foo directCallVoidReturn]; side_effect", result_value="4321")
+ //%self.expect_expr("[foo directCallNSStringArg: str]", result_summary='@"some string"')
+ //%self.expect_expr("[foo directCallIdArg: (id)str]", result_summary='@"some string appendix"')
+ //%self.expect_expr("[foo directCallConflictingName]", result_summary='"correct function"')
+ //%self.expect_expr("[foo directCallWithCategory]", result_summary='"called function with category"')
return 0;
}