2 Test more expression command sequences with objective-c.
7 from lldbsuite
.test
.decorators
import *
8 from lldbsuite
.test
.lldbtest
import *
9 from lldbsuite
.test
import lldbutil
12 class FoundationTestCaseString(TestBase
):
13 def test_NSString_expr_commands(self
):
14 """Test expression commands for NSString."""
16 self
.target
, process
, thread
, bkpt
= lldbutil
.run_to_source_breakpoint(
17 self
, "// Break here for NSString tests", lldb
.SBFileSpec("main.m", False)
20 self
.runCmd("settings set target.prefer-dynamic-value no-dynamic-values")
23 self
.runCmd("thread backtrace")
24 self
.expect("expression (int)[str length]", patterns
=["\(int\) \$.* ="])
25 self
.expect("expression (int)[str_id length]", patterns
=["\(int\) \$.* ="])
26 self
.expect("expression (id)[str description]", patterns
=["\(id\) \$.* = 0x"])
28 "expression (id)[str_id description]", patterns
=["\(id\) \$.* = 0x"]
30 self
.expect("expression str.length")
31 self
.expect('expression str = @"new"')
32 self
.runCmd("image lookup -t NSString")
33 self
.expect('expression str = (id)[NSString stringWithCString: "new"]')
34 self
.runCmd("process continue")
36 @expectedFailureAll(archs
=["i[3-6]86"], bugnumber
="<rdar://problem/28814052>")
37 def test_MyString_dump_with_runtime(self
):
38 """Test dump of a known Objective-C object by dereferencing it."""
40 self
.target
, process
, thread
, bkpt
= lldbutil
.run_to_source_breakpoint(
41 self
, "// Set break point at this line", lldb
.SBFileSpec("main.m", False)
44 "expression --show-types -- *my",
45 patterns
=["\(MyString\) \$.* = ", "\(MyBase\)"],
47 self
.runCmd("process continue")