2 Test that Objective-C methods from the runtime work correctly.
5 from __future__ import print_function
11 from lldbsuite.test.decorators import *
12 from lldbsuite.test.lldbtest import *
13 from lldbsuite.test import lldbutil
17 class RuntimeTypesTestCase(TestBase):
19 mydir = TestBase.compute_mydir(__file__)
23 debug_info="gmodules",
24 bugnumber="llvm.org/pr27862")
26 """Test setting objc breakpoints using '_regexp-break' and 'breakpoint set'."""
27 if self.getArchitecture() != 'x86_64':
28 self.skipTest("This only applies to the v2 runtime")
31 exe = os.path.join(os.getcwd(), "a.out")
32 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
34 # Stop at -[MyString description].
35 lldbutil.run_break_set_by_symbol(
37 '-[MyString description]',
38 num_expected_locations=1,
41 self.runCmd("run", RUN_SUCCEEDED)
43 # The backtrace should show we stop at -[MyString description].
44 self.expect("thread backtrace", "Stop at -[MyString description]",
45 substrs=["a.out`-[MyString description]"])
47 # Use runtime information about NSString.
49 # The length property should be usable.
50 self.expect("expression str.length", VARIABLES_DISPLAYED_CORRECTLY,
51 patterns=[r"(\(unsigned long long\))|\(NSUInteger\)"])
53 # Static methods on NSString should work.
55 "expr [NSString stringWithCString:\"foo\" encoding:1]",
61 self.expect("po $1", VARIABLES_DISPLAYED_CORRECTLY,