2 Test lldb data formatter subsystem.
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
13 class NSArraySyntheticTestCase(TestBase):
15 mydir = TestBase.compute_mydir(__file__)
18 # Call super's setUp().
20 # Find the line number to break at.
21 self.line = line_number('main.m', '// Set break point at this line.')
24 def test_rdar11086338_with_run_command(self):
25 """Test that NSArray reports its synthetic children properly."""
27 self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
29 lldbutil.run_break_set_by_file_and_line(
30 self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
32 self.runCmd("run", RUN_SUCCEEDED)
34 # The stop reason of the thread should be breakpoint.
35 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
37 'stop reason = breakpoint'])
39 # This is the function to remove the custom formats in order to have a
40 # clean slate for the next test case.
42 self.runCmd('type format clear', check=False)
43 self.runCmd('type summary clear', check=False)
44 self.runCmd('type synth clear', check=False)
46 # Execute the cleanup function during test case tear down.
47 self.addTearDownHook(cleanup)
49 # Now check that we are displaying Cocoa classes correctly
50 self.expect('frame variable arr',
51 substrs=['@"6 elements"'])
52 self.expect('frame variable other_arr',
53 substrs=['@"4 elements"'])
55 'frame variable arr --ptr-depth 1',
65 'frame variable other_arr --ptr-depth 1',
73 'frame variable arr --ptr-depth 1 -d no-run-target',
81 '@"http://www.apple.com'])
83 'frame variable other_arr --ptr-depth 1 -d no-run-target',
90 'frame variable other_arr --ptr-depth 2 -d no-run-target',
99 '@"http://www.apple.com'])
102 self.frame().FindVariable("arr").MightHaveChildren(),
103 "arr says it does not have children!")
105 self.frame().FindVariable("other_arr").MightHaveChildren(),
106 "arr says it does not have children!")