3 Test lldb data formatter subsystem.
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
12 from ObjCDataFormatterTestCase import ObjCDataFormatterTestCase
15 class ObjCDataFormatterCF(ObjCDataFormatterTestCase):
18 def test_coreframeworks_and_run_command(self):
19 """Test formatters for Core OSX frameworks."""
21 self.target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
22 self, '// Set break point at this line.',
23 lldb.SBFileSpec('main.m', False))
25 # The stop reason of the thread should be breakpoint.
28 STOPPED_DUE_TO_BREAKPOINT,
29 substrs=['stopped', 'stop reason = breakpoint'])
31 # check formatters for common Objective-C types
33 '(CFGregorianUnits) cf_greg_units = 1 years, 3 months, 5 days, 12 hours, 5 minutes 7 seconds',
34 '(CFRange) cf_range = location=4 length=4',
35 '(NSPoint) ns_point = (x = 4, y = 4)',
36 '(NSRange) ns_range = location=4, length=4',
37 '(NSRect) ns_rect = (origin = (x = 1, y = 1), size = (width = 5, height = 5))',
38 '(NSRectArray) ns_rect_arr = ((x = 1, y = 1), (width = 5, height = 5)), ...',
39 '(NSSize) ns_size = (width = 5, height = 7)',
40 '(CGSize) cg_size = (width = 1, height = 6)',
41 '(CGPoint) cg_point = (x = 2, y = 7)',
42 '(CGRect) cg_rect = (origin = (x = 1, y = 2), size = (width = 7, height = 7))',
43 '(Rect) rect = (t=4, l=8, b=4, r=7)',
44 '(Rect *) rect_ptr = (t=4, l=8, b=4, r=7)',
45 '(Point) point = (v=7, h=12)', '(Point *) point_ptr = (v=7, h=12)',
46 '1985', 'foo_selector_impl'
49 if self.getArchitecture() in ['i386', 'x86_64']:
50 expect_strings.append('(HIPoint) hi_point = (x=7, y=12)')
51 expect_strings.append(
52 '(HIRect) hi_rect = origin=(x = 3, y = 5) size=(width = 4, height = 6)'
54 expect_strings.append(
55 '(RGBColor) rgb_color = red=3 green=56 blue=35')
56 expect_strings.append(
57 '(RGBColor *) rgb_color_ptr = red=3 green=56 blue=35')
59 self.expect("frame variable", substrs=expect_strings)