2 Test lldb data formatter subsystem.
5 from __future__ import print_function
11 from lldbsuite.test.lldbtest import *
12 import lldbsuite.test.lldbutil as lldbutil
14 class StdIteratorDataFormatterTestCase(TestBase):
16 mydir = TestBase.compute_mydir(__file__)
19 # Call super's setUp().
21 # Find the line number to break at.
22 self.line = line_number('main.cpp', '// Set break point at this line.')
24 @skipIfWindows # libstdcpp not ported to Windows
25 @expectedFailureIcc # llvm.org/pr15301 LLDB prints incorrect sizes of STL containers
26 def test_with_run_command(self):
27 """Test that libstdcpp iterators format properly."""
29 self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
31 lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
33 self.runCmd("run", RUN_SUCCEEDED)
35 # The stop reason of the thread should be breakpoint.
36 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
38 'stop reason = breakpoint'])
40 # This is the function to remove the custom formats in order to have a
41 # clean slate for the next test case.
43 self.runCmd('type format clear', check=False)
44 self.runCmd('type summary clear', check=False)
45 self.runCmd('type filter clear', check=False)
46 self.runCmd('type synth clear', check=False)
47 self.runCmd("settings set target.max-children-count 256", check=False)
49 # Execute the cleanup function during test case tear down.
50 self.addTearDownHook(cleanup)
52 self.expect('frame variable ivI', substrs = ['item = 3'])
53 self.expect('expr ivI', substrs = ['item = 3'])
55 self.expect('frame variable iimI', substrs = ['first = 0','second = 12'])
56 self.expect('expr iimI', substrs = ['first = 0','second = 12'])
58 self.expect('frame variable simI', substrs = ['first = "world"','second = 42'])
59 self.expect('expr simI', substrs = ['first = "world"','second = 42'])
61 self.expect('frame variable svI', substrs = ['item = "hello"'])
62 self.expect('expr svI', substrs = ['item = "hello"'])