2 Test lldb data formatter subsystem.
5 from __future__ import print_function
11 from lldbsuite.test.decorators import *
12 from lldbsuite.test.lldbtest import *
13 from lldbsuite.test import lldbutil
15 class LibcxxSetDataFormatterTestCase(TestBase):
17 mydir = TestBase.compute_mydir(__file__)
19 @skipIf(compiler="gcc")
20 @skipIfWindows # libc++ not ported to Windows yet
21 def test_with_run_command(self):
22 """Test that that file and class static variables display correctly."""
24 self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
26 # bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))
28 self.runCmd("run", RUN_SUCCEEDED)
30 # lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
32 # # The stop reason of the thread should be breakpoint.
33 # self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
34 # substrs = ['stopped',
35 # 'stop reason = breakpoint'])
37 # # This is the function to remove the custom formats in order to have a
38 # # clean slate for the next test case.
40 # self.runCmd('type format clear', check=False)
41 # self.runCmd('type summary clear', check=False)
42 # self.runCmd('type filter clear', check=False)
43 # self.runCmd('type synth clear', check=False)
44 # self.runCmd("settings set target.max-children-count 256", check=False)
46 # # Execute the cleanup function during test case tear down.
47 # self.addTearDownHook(cleanup)
49 # self.expect('image list', substrs = self.getLibcPlusPlusLibs())
51 # self.expect("frame variable ii",substrs = ["size=0","{}"])
52 # lldbutil.continue_to_breakpoint(self.process(), bkpt)
53 # self.expect("frame variable ii",substrs = ["size=6","[0] = 0","[1] = 1", "[2] = 2", "[3] = 3", "[4] = 4", "[5] = 5"])
54 # lldbutil.continue_to_breakpoint(self.process(), bkpt)
55 # self.expect("frame variable ii",substrs = ["size=7","[2] = 2", "[3] = 3", "[6] = 6"])
56 # self.expect("frame variable ii[2]",substrs = [" = 2"])
57 # self.expect("p ii",substrs = ["size=7","[2] = 2", "[3] = 3", "[6] = 6"])
58 # lldbutil.continue_to_breakpoint(self.process(), bkpt)
59 # self.expect("frame variable ii",substrs = ["size=0","{}"])
60 # lldbutil.continue_to_breakpoint(self.process(), bkpt)
61 # self.expect("frame variable ii",substrs = ["size=0","{}"])
62 # self.expect("frame variable ss",substrs = ["size=0","{}"])
63 # lldbutil.continue_to_breakpoint(self.process(), bkpt)
64 # self.expect("frame variable ss",substrs = ["size=2",'[0] = "a"','[1] = "a very long string is right here"'])
65 # lldbutil.continue_to_breakpoint(self.process(), bkpt)
66 # self.expect("frame variable ss",substrs = ["size=4",'[2] = "b"','[3] = "c"','[0] = "a"','[1] = "a very long string is right here"'])
67 # self.expect("p ss",substrs = ["size=4",'[2] = "b"','[3] = "c"','[0] = "a"','[1] = "a very long string is right here"'])
68 # self.expect("frame variable ss[2]",substrs = [' = "b"'])
69 # lldbutil.continue_to_breakpoint(self.process(), bkpt)
70 # self.expect("frame variable ss",substrs = ["size=3",'[0] = "a"','[1] = "a very long string is right here"','[2] = "c"'])