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 PrintObjectArrayTestCase(TestBase):
15 mydir = TestBase.compute_mydir(__file__)
18 def test_print_array(self):
19 """Test that expr -O -Z works"""
21 self.printarray_data_formatter_commands()
24 # Call super's setUp().
26 # Find the line number to break at.
27 self.line = line_number('main.mm', 'break here')
29 def printarray_data_formatter_commands(self):
30 """Test that expr -O -Z works"""
31 self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
33 lldbutil.run_break_set_by_file_and_line(
34 self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
36 self.runCmd("run", RUN_SUCCEEDED)
38 # The stop reason of the thread should be breakpoint.
39 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
41 'stop reason = breakpoint'])
43 # This is the function to remove the custom formats in order to have a
44 # clean slate for the next test case.
46 self.runCmd('type format clear', check=False)
47 self.runCmd('type summary clear', check=False)
48 self.runCmd('type synth clear', check=False)
50 # Execute the cleanup function during test case tear down.
51 self.addTearDownHook(cleanup)
54 'expr --element-count 3 --object-description -- objects',
74 'expr --element-count 3 --object-description --description-verbosity=full -- objects',
93 'expr --element-count 3 -d run -- objects',
99 'expr --element-count 3 -d run --ptr-depth=1 -- objects',