1 2 3import lldb 4from lldbsuite.test.decorators import * 5from lldbsuite.test.lldbtest import * 6from lldbsuite.test import lldbutil 7 8 9class ExprXValuePrintingTestCase(TestBase): 10 11 mydir = TestBase.compute_mydir(__file__) 12 13 def setUp(self): 14 # Call super's setUp(). 15 TestBase.setUp(self) 16 17 self.main_source = "main.cpp" 18 self.main_source_spec = lldb.SBFileSpec(self.main_source) 19 20 def do_test(self, dictionary=None): 21 """Printing an xvalue should work.""" 22 self.build(dictionary=dictionary) 23 24 (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self, 25 '// Break here', self.main_source_spec) 26 frame = thread.GetFrameAtIndex(0) 27 28 value = frame.EvaluateExpression("foo().data") 29 self.assertTrue(value.IsValid()) 30 self.assertTrue(value.GetError().Success()) 31 self.assertEqual(value.GetValueAsSigned(), 1234) 32 33 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765") 34 def test(self): 35 self.do_test() 36 37