-"""
+"""
Test 'watchpoint command'.
"""
substrs=['stop reason = watchpoint'])
# Check that the watchpoint snapshoting mechanism is working.
- self.expect("watchpoint list -v",
- substrs=['old value:', ' = 0',
- 'new value:', ' = 1'])
+ self.expect(
+ "watchpoint list -v",
+ substrs=[
+ 'old value: 0', 'new value: 1', 'hw_index = 0',
+ 'hit_count = 1', 'ignore_count = 0'
+ ])
# The watchpoint command "forced" our global variable 'cookie' to
# become 777.
self.runCmd("type summary add -c -x \"i_am_cool \[[0-9]\]\"")
self.runCmd("type summary add -c i_am_cool")
- self.expect("frame variable cool_array",
- substrs=['[0]',
- '[1]',
- '[2]',
- '[3]',
- '[4]',
- 'integer',
- 'character',
- 'floating'])
+ self.expect(
+ "frame variable cool_array",
+ substrs=[
+ '[0]',
+ 'integer',
+ 'floating',
+ 'character',
+ '[1]',
+ 'integer',
+ 'floating',
+ 'character',
+ '[2]',
+ 'integer',
+ 'floating',
+ 'character',
+ '[3]',
+ 'integer',
+ 'floating',
+ 'character',
+ '[4]',
+ 'integer',
+ 'floating',
+ 'character',
+ ])
self.runCmd(
"type summary add --summary-string \"int = ${*var.int_pointer}, float = ${*var.float_pointer}\" IWrapPointers")
matching=True,
substrs=[
'e_2',
- 'n_2',
- 'r_2',
'i_2',
'k_2',
- 'o_2'])
+ 'n_2',
+ 'o_2',
+ 'r_2',
+ ])
self.expect(
'frame variable a_long_guy --show-all-children',
matching=False,
self.runCmd("type format add -C yes -f c Type1")
# The type format list should show our custom formats.
- self.expect("type format list",
- substrs=['RealNumber',
- 'Speed',
- 'BitField',
- 'Type1',
- 'Type2'])
+ self.expect(
+ "type format list",
+ substrs=['Speed', 'BitField', 'RealNumber', 'Type2', 'Type1'])
self.expect("frame variable",
patterns=['\(Speed\) SPILookHex = 0x[0-9a-f]+' # Speed should look hex-ish now.
# check formatters for common Objective-C types
expect_strings = [
'(CFGregorianUnits) cf_greg_units = 1 years, 3 months, 5 days, 12 hours, 5 minutes 7 seconds',
+ '(CFGregorianDate) cf_greg_date = @"4/11/1985 2:0:0"',
'(CFRange) cf_range = location=4 length=4',
'(NSPoint) ns_point = (x = 4, y = 4)',
'(NSRange) ns_range = location=4, length=4',
'(Rect) rect = (t=4, l=8, b=4, r=7)',
'(Rect *) rect_ptr = (t=4, l=8, b=4, r=7)',
'(Point) point = (v=7, h=12)', '(Point *) point_ptr = (v=7, h=12)',
- '1985', 'foo_selector_impl'
+ '(SEL) foo_selector = "foo_selector_impl"'
]
- if self.getArchitecture() in ['i386', 'x86_64']:
- expect_strings.append('(HIPoint) hi_point = (x=7, y=12)')
- expect_strings.append(
- '(HIRect) hi_rect = origin=(x = 3, y = 5) size=(width = 4, height = 6)'
- )
- expect_strings.append(
- '(RGBColor) rgb_color = red=3 green=56 blue=35')
- expect_strings.append(
- '(RGBColor *) rgb_color_ptr = red=3 green=56 blue=35')
-
self.expect("frame variable", substrs=expect_strings)
+
+ if self.getArchitecture() in ['i386', 'x86_64']:
+ extra_string = [
+ '(RGBColor) rgb_color = red=3 green=56 blue=35',
+ '(RGBColor *) rgb_color_ptr = red=3 green=56 blue=35',
+ '(HIPoint) hi_point = (x=7, y=12)',
+ '(HIRect) hi_rect = origin=(x = 3, y = 5) size=(width = 4, height = 6)',
+ ]
+ self.expect("frame variable", substrs=extra_string)
self.expect(
'frame variable newArray nsDictionary newDictionary nscfDictionary cfDictionaryRef newMutableDictionary cfarray_ref mutable_array_ref',
substrs=[
- '(NSArray *) newArray = ', '@"50 elements"',
- '(NSDictionary *) newDictionary = ', ' 12 key/value pairs',
+ '(NSArray *) newArray = ',
+ ' @"50 elements"',
+ '(NSDictionary *) nsDictionary = ',
+ ' 2 key/value pairs',
+ '(NSDictionary *) newDictionary = ',
+ ' 12 key/value pairs',
+ '(CFDictionaryRef) cfDictionaryRef = ',
+ ' 3 key/value pairs',
'(NSDictionary *) newMutableDictionary = ',
- ' 21 key/value pairs', '(NSDictionary *) nsDictionary = ',
- ' 2 key/value pairs', '(CFDictionaryRef) cfDictionaryRef = ',
- ' 3 key/value pairs', '(CFArrayRef) cfarray_ref = ',
- '@"3 elements"', '(CFMutableArrayRef) mutable_array_ref = ',
- '@"11 elements"'
+ ' 21 key/value pairs',
+ '(CFArrayRef) cfarray_ref = ',
+ ' @"3 elements"',
+ '(CFMutableArrayRef) mutable_array_ref = ',
+ ' @"11 elements"',
])
self.expect(
self.expect(
'frame variable nserror->_userInfo --ptr-depth 1 -d run-target',
- substrs=['@"a"', '@"b"', "1", "2"])
+ substrs=['@"a"', "1", '@"b"', "2"])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable si",
- substrs=['%s::map' % ns, 'size=4',
- '[0] = ',
- 'first = \"zero\"',
- 'second = 0',
- '[1] = ',
- 'first = \"one\"',
- 'second = 1',
- '[2] = ',
- 'first = \"two\"',
- 'second = 2',
- '[3] = ',
- 'first = \"three\"',
- 'second = 3'])
-
- self.expect("p si",
- substrs=['%s::map' % ns, 'size=4',
- '[0] = ',
- 'first = \"zero\"',
- 'second = 0',
- '[1] = ',
- 'first = \"one\"',
- 'second = 1',
- '[2] = ',
- 'first = \"two\"',
- 'second = 2',
- '[3] = ',
- 'first = \"three\"',
- 'second = 3'])
+ self.expect(
+ "frame variable si",
+ substrs=[
+ '%s::map' % ns,
+ 'size=4',
+ '[0] = (first = "one", second = 1)',
+ '[1] = (first = "three", second = 3)',
+ '[2] = (first = "two", second = 2)',
+ '[3] = (first = "zero", second = 0)',
+ ])
+
+ self.expect(
+ "p si",
+ substrs=[
+ '%s::map' % ns,
+ 'size=4',
+ '[0] = (first = "one", second = 1)',
+ '[1] = (first = "three", second = 3)',
+ '[2] = (first = "two", second = 2)',
+ '[3] = (first = "zero", second = 0)',
+ ])
# check that MightHaveChildren() gets it right
self.assertTrue(
lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable is",
- substrs=['%s::map' % ns, 'size=4',
- '[0] = ',
- 'second = \"goofy\"',
- 'first = 85',
- '[1] = ',
- 'second = \"is\"',
- 'first = 1',
- '[2] = ',
- 'second = \"smart\"',
- 'first = 2',
- '[3] = ',
- 'second = \"!!!\"',
- 'first = 3'])
-
- self.expect("p is",
- substrs=['%s::map' % ns, 'size=4',
- '[0] = ',
- 'second = \"goofy\"',
- 'first = 85',
- '[1] = ',
- 'second = \"is\"',
- 'first = 1',
- '[2] = ',
- 'second = \"smart\"',
- 'first = 2',
- '[3] = ',
- 'second = \"!!!\"',
- 'first = 3'])
+ self.expect(
+ "frame variable is",
+ substrs=[
+ '%s::map' % ns,
+ 'size=4',
+ '[0] = (first = 1, second = "is")',
+ '[1] = (first = 2, second = "smart")',
+ '[2] = (first = 3, second = "!!!")',
+ '[3] = (first = 85, second = "goofy")',
+ ])
+
+ self.expect(
+ "p is",
+ substrs=[
+ '%s::map' % ns,
+ 'size=4',
+ '[0] = (first = 1, second = "is")',
+ '[1] = (first = 2, second = "smart")',
+ '[2] = (first = 3, second = "!!!")',
+ '[3] = (first = 85, second = "goofy")',
+ ])
# check that MightHaveChildren() gets it right
self.assertTrue(
lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable ss",
- substrs=['%s::map' % ns, 'size=3',
- '[0] = ',
- 'second = \"hello\"',
- 'first = \"ciao\"',
- '[1] = ',
- 'second = \"house\"',
- 'first = \"casa\"',
- '[2] = ',
- 'second = \"cat\"',
- 'first = \"gatto\"'])
-
- self.expect("p ss",
- substrs=['%s::map' % ns, 'size=3',
- '[0] = ',
- 'second = \"hello\"',
- 'first = \"ciao\"',
- '[1] = ',
- 'second = \"house\"',
- 'first = \"casa\"',
- '[2] = ',
- 'second = \"cat\"',
- 'first = \"gatto\"'])
+ self.expect(
+ "frame variable ss",
+ substrs=[
+ '%s::map' % ns,
+ 'size=3',
+ '[0] = (first = "casa", second = "house")',
+ '[1] = (first = "ciao", second = "hello")',
+ '[2] = (first = "gatto", second = "cat")',
+ ])
+
+ self.expect(
+ "p ss",
+ substrs=[
+ '%s::map' % ns,
+ 'size=3',
+ '[0] = (first = "casa", second = "house")',
+ '[1] = (first = "ciao", second = "hello")',
+ '[2] = (first = "gatto", second = "cat")',
+ ])
# check that MightHaveChildren() gets it right
self.assertTrue(
lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect('frame variable ii',
- substrs=[multimap, 'size=2',
- '[0] = ',
- 'first = 0',
- 'second = 0',
- '[1] = ',
- 'first = 1',
- 'second = 1'])
+ self.expect(
+ 'frame variable ii',
+ substrs=[
+ multimap,
+ 'size=2',
+ '[0] = (first = 0, second = 0)',
+ '[1] = (first = 1, second = 1)',
+ ])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable si",
- substrs=[multimap, 'size=4',
- '[0] = ',
- 'first = \"zero\"',
- 'second = 0',
- '[1] = ',
- 'first = \"one\"',
- 'second = 1',
- '[2] = ',
- 'first = \"two\"',
- 'second = 2',
- '[3] = ',
- 'first = \"three\"',
- 'second = 3'])
+ self.expect(
+ "frame variable si",
+ substrs=[
+ multimap,
+ 'size=4',
+ '[0] = (first = "one", second = 1)',
+ '[1] = (first = "three", second = 3)',
+ '[2] = (first = "two", second = 2)',
+ '[3] = (first = "zero", second = 0)',
+ ])
self.expect("p si",
substrs=[multimap, 'size=4',
- '[0] = ',
- 'first = \"zero\"',
- 'second = 0',
- '[1] = ',
- 'first = \"one\"',
- 'second = 1',
- '[2] = ',
- 'first = \"two\"',
- 'second = 2',
- '[3] = ',
- 'first = \"three\"',
- 'second = 3'])
+ '[0] = (first = "one", second = 1)',
+ '[1] = (first = "three", second = 3)',
+ '[2] = (first = "two", second = 2)',
+ '[3] = (first = "zero", second = 0)',
+ ])
# check that MightHaveChildren() gets it right
self.assertTrue(
lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable is",
- substrs=[multimap, 'size=4',
- '[0] = ',
- 'second = \"goofy\"',
- 'first = 85',
- '[1] = ',
- 'second = \"is\"',
- 'first = 1',
- '[2] = ',
- 'second = \"smart\"',
- 'first = 2',
- '[3] = ',
- 'second = \"!!!\"',
- 'first = 3'])
-
- self.expect("p is",
- substrs=[multimap, 'size=4',
- '[0] = ',
- 'second = \"goofy\"',
- 'first = 85',
- '[1] = ',
- 'second = \"is\"',
- 'first = 1',
- '[2] = ',
- 'second = \"smart\"',
- 'first = 2',
- '[3] = ',
- 'second = \"!!!\"',
- 'first = 3'])
+ self.expect(
+ "frame variable is",
+ substrs=[
+ multimap,
+ 'size=4',
+ '[0] = (first = 1, second = "is")',
+ '[1] = (first = 2, second = "smart")',
+ '[2] = (first = 3, second = "!!!")',
+ '[3] = (first = 85, second = "goofy")',
+ ])
+
+ self.expect(
+ "p is",
+ substrs=[
+ multimap,
+ 'size=4',
+ '[0] = (first = 1, second = "is")',
+ '[1] = (first = 2, second = "smart")',
+ '[2] = (first = 3, second = "!!!")',
+ '[3] = (first = 85, second = "goofy")',
+ ])
# check that MightHaveChildren() gets it right
self.assertTrue(
lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect("frame variable ss",
- substrs=[multimap, 'size=3',
- '[0] = ',
- 'second = \"hello\"',
- 'first = \"ciao\"',
- '[1] = ',
- 'second = \"house\"',
- 'first = \"casa\"',
- '[2] = ',
- 'second = \"cat\"',
- 'first = \"gatto\"'])
-
- self.expect("p ss",
- substrs=[multimap, 'size=3',
- '[0] = ',
- 'second = \"hello\"',
- 'first = \"ciao\"',
- '[1] = ',
- 'second = \"house\"',
- 'first = \"casa\"',
- '[2] = ',
- 'second = \"cat\"',
- 'first = \"gatto\"'])
+ self.expect(
+ "frame variable ss",
+ substrs=[
+ multimap,
+ 'size=3',
+ '[0] = (first = "casa", second = "house")',
+ '[1] = (first = "ciao", second = "hello")',
+ '[2] = (first = "gatto", second = "cat")',
+ ])
+
+ self.expect(
+ "p ss",
+ substrs=[
+ multimap,
+ 'size=3',
+ '[0] = (first = "casa", second = "house")',
+ '[1] = (first = "ciao", second = "hello")',
+ '[2] = (first = "gatto", second = "cat")',
+ ])
# check that MightHaveChildren() gets it right
self.assertTrue(
"frame variable ss",
substrs=[
"size=4",
+ '[0] = "a"',
+ '[1] = "a very long string is right here"',
'[2] = "b"',
'[3] = "c"',
- '[0] = "a"',
- '[1] = "a very long string is right here"'])
+ ])
self.expect(
"p ss",
substrs=[
"size=4",
+ '[0] = "a"',
+ '[1] = "a very long string is right here"',
'[2] = "b"',
'[3] = "c"',
- '[0] = "a"',
- '[1] = "a very long string is right here"'])
+ ])
self.expect("frame variable ss[2]", substrs=[' = "b"'])
lldbutil.continue_to_breakpoint(process, bkpt)
self.expect(