2 Test lldb data formatter subsystem.
8 from lldbsuite.test.lldbtest import *
9 import lldbsuite.test.lldbutil as lldbutil
12 class Radar9974002DataFormatterTestCase(TestBase):
14 # test for rdar://problem/9974002 ()
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.cpp', '// Set break point at this line.')
23 def test_with_run_command(self):
24 """Test that that file and class static variables display correctly."""
26 if "clang" in self.getCompiler() and "3.4" in self.getCompilerVersion():
28 "llvm.org/pr16214 -- clang emits partial DWARF for structures referenced via typedef")
30 self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
32 lldbutil.run_break_set_by_file_and_line(
33 self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
35 self.runCmd("run", RUN_SUCCEEDED)
37 # The stop reason of the thread should be breakpoint.
38 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
40 'stop reason = breakpoint'])
42 # This is the function to remove the custom formats in order to have a
43 # clean slate for the next test case.
45 self.runCmd('type summary clear', check=False)
47 # Execute the cleanup function during test case tear down.
48 self.addTearDownHook(cleanup)
51 "type summary add -s \"${var.scalar} and ${var.pointer.first}\" container")
53 self.expect('frame variable mine',
55 '1', '<parent is NULL>'])
58 "type summary add -s \"${var.scalar} and ${var.pointer}\" container")
60 self.expect('frame variable mine',
65 "type summary add -s \"${var.scalar} and ${var.pointer%S}\" container")
67 self.expect('frame variable mine',
71 self.runCmd("type summary add -s foo contained")
73 self.expect('frame variable mine',
78 "type summary add -s \"${var.scalar} and ${var.pointer}\" container")
80 self.expect('frame variable mine',
85 "type summary add -s \"${var.scalar} and ${var.pointer%V}\" container")
87 self.expect('frame variable mine',
92 "type summary add -s \"${var.scalar} and ${var.pointer.first}\" container")
94 self.expect('frame variable mine',
96 '1', '<parent is NULL>'])
98 self.runCmd("type summary delete contained")
101 self.expect('frame variable mine',
103 '1', '<parent is NULL>'])
106 "type summary add -s \"${var.scalar} and ${var.pointer}\" container")
108 self.expect('frame variable mine',
113 "type summary add -s \"${var.scalar} and ${var.pointer%S}\" container")
115 self.expect('frame variable mine',
119 self.runCmd("type summary add -s foo contained")
121 self.expect('frame variable mine',
126 "type summary add -s \"${var.scalar} and ${var.pointer}\" container")
128 self.expect('frame variable mine',
133 "type summary add -s \"${var.scalar} and ${var.pointer%V}\" container")
135 self.expect('frame variable mine',
140 "type summary add -s \"${var.scalar} and ${var.pointer.first}\" container")
142 self.expect('frame variable mine',
144 '1', '<parent is NULL>'])