self.runCmd("run", RUN_SUCCEEDED)
+ process = self.dbg.GetSelectedTarget().GetProcess()
+
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs = ['stopped',
# print the f00_1 variable without a synth
self.expect("frame variable f00_1",
- substrs = ['a = 0',
- 'b = 1',
- 'r = 33']);
+ substrs = ['a = 1',
+ 'b = 2',
+ 'r = 34']);
# now set up the synth
self.runCmd("script from fooSynthProvider import *")
self.runCmd("type synth add -l fooSynthProvider foo")
self.expect("type synthetic list foo", substrs=['fooSynthProvider'])
+ # note that the value of fake_a depends on target byte order
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ fake_a_val = 0x02000000
+ else:
+ fake_a_val = 0x00000100
+
# check that we get the two real vars and the fake_a variables
self.expect("frame variable f00_1",
- substrs = ['r = 33',
- 'fake_a = 16777216',
- 'a = 0']);
+ substrs = ['r = 34',
+ 'fake_a = %d' % fake_a_val,
+ 'a = 1']);
# check that we do not get the extra vars
self.expect("frame variable f00_1", matching=False,
- substrs = ['b = 1']);
+ substrs = ['b = 2']);
# check access to members by name
self.expect('frame variable f00_1.fake_a',
- substrs = ['16777216'])
+ substrs = ['%d' % fake_a_val])
# check access to members by index
self.expect('frame variable f00_1[1]',
- substrs = ['16777216'])
+ substrs = ['%d' % fake_a_val])
# put synthetic children in summary in several combinations
self.runCmd("type summary add --summary-string \"fake_a=${svar.fake_a}\" foo")
self.expect('frame variable f00_1',
- substrs = ['fake_a=16777216'])
+ substrs = ['fake_a=%d' % fake_a_val])
self.runCmd("type summary add --summary-string \"fake_a=${svar[1]}\" foo")
self.expect('frame variable f00_1',
- substrs = ['fake_a=16777216'])
+ substrs = ['fake_a=%d' % fake_a_val])
# clear the summary
self.runCmd("type summary delete foo")
# check that the caching does not span beyond the stopoint
self.runCmd("n")
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ fake_a_val = 0x02000000
+ else:
+ fake_a_val = 0x00000200
+
self.expect("frame variable f00_1",
- substrs = ['r = 33',
- 'fake_a = 16777216',
- 'a = 1']);
+ substrs = ['r = 34',
+ 'fake_a = %d' % fake_a_val,
+ 'a = 2']);
# check that altering the object also alters fake_a
self.runCmd("expr f00_1.a = 280")
+
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ fake_a_val = 0x02000001
+ else:
+ fake_a_val = 0x00011800
+
self.expect("frame variable f00_1",
- substrs = ['r = 33',
- 'fake_a = 16777217',
+ substrs = ['r = 34',
+ 'fake_a = %d' % fake_a_val,
'a = 280']);
# check that expanding a pointer does the right thing
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ fake_a_val = 0x0d000000
+ else:
+ fake_a_val = 0x00000c00
+
self.expect("frame variable --ptr-depth 1 f00_ptr",
- substrs = ['r = 45',
- 'fake_a = 218103808',
- 'a = 12'])
+ substrs = ['r = 45',
+ 'fake_a = %d' % fake_a_val,
+ 'a = 12'])
# now add a filter.. it should fail
self.expect("type filter add foo --child b --child j", error=True,
'j = 17'])
self.expect("frame variable --ptr-depth 1 f00_ptr",
substrs = ['r = 45',
- 'fake_a = 218103808',
+ 'fake_a = %d' % fake_a_val,
'a = 12'])
# now delete the synth and add the filter
self.runCmd("type filter add foo --child b --child j")
self.expect('frame variable f00_1',
- substrs = ['b = 1',
- 'j = 17'])
+ substrs = ['b = 2',
+ 'j = 18'])
self.expect("frame variable --ptr-depth 1 f00_ptr", matching=False,
substrs = ['r = 45',
- 'fake_a = 218103808',
+ 'fake_a = %d' % fake_a_val,
'a = 12'])
# now add the synth and it should fail
self.runCmd("type synth add -l fooSynthProvider foo")
self.expect('frame variable f00_1', matching=False,
- substrs = ['b = 1',
- 'j = 17'])
+ substrs = ['b = 2',
+ 'j = 18'])
self.expect("frame variable --ptr-depth 1 f00_ptr",
substrs = ['r = 45',
- 'fake_a = 218103808',
+ 'fake_a = %d' % fake_a_val,
'a = 12'])
# check the listing
self.expect("frame variable f00_1",
substrs = ['a = 280',
- 'b = 1',
- 'j = 17']);
+ 'b = 2',
+ 'j = 18']);
self.expect("frame variable f00_1", matching=False,
substrs = ['fake_a = '])
self.runCmd("run", RUN_SUCCEEDED)
+ process = self.dbg.GetSelectedTarget().GetProcess()
+
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs = ['stopped',
self.runCmd("type summary add --summary-string \"arr = ${var%y}\" \"float [7]\"")
self.runCmd("type summary add --summary-string \"arr = ${var%y}\" \"int [5]\"")
- self.expect("frame variable flarr",
- substrs = ['flarr = arr =',
- '00 00 9d 42,00 80 9a 42,00 00 9c 42,00 40 98 42,00 80 99 42,00 c0 99 42,00 00 9a 42'])
-
- self.expect("frame variable other.flarr",
- substrs = ['flarr = arr =',
- '00 00 cc 41,00 00 ca 41,00 00 c9 41,00 00 d6 41,00 00 db 41,00 00 dc 41,00 00 d1 41'])
-
- self.expect("frame variable intarr",
- substrs = ['intarr = arr =',
- '01 00 00 00,01 00 00 00,02 00 00 00,03 00 00 00,05 00 00 00'])
-
- self.expect("frame variable other.intarr",
- substrs = ['intarr = arr = ',
- '09 00 00 00,08 00 00 00,07 00 00 00,06 00 00 00,05 00 00 00'])
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ self.expect("frame variable flarr",
+ substrs = ['flarr = arr =',
+ '00 00 9d 42,00 80 9a 42,00 00 9c 42,00 40 98 42,00 80 99 42,00 c0 99 42,00 00 9a 42'])
+ else:
+ self.expect("frame variable flarr",
+ substrs = ['flarr = arr =',
+ '42 9d 00 00,42 9a 80 00,42 9c 00 00,42 98 40 00,42 99 80 00,42 99 c0 00,42 9a 00 00'])
+
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ self.expect("frame variable other.flarr",
+ substrs = ['flarr = arr =',
+ '00 00 cc 41,00 00 ca 41,00 00 c9 41,00 00 d6 41,00 00 db 41,00 00 dc 41,00 00 d1 41'])
+ else:
+ self.expect("frame variable other.flarr",
+ substrs = ['flarr = arr =',
+ '41 cc 00 00,41 ca 00 00,41 c9 00 00,41 d6 00 00,41 db 00 00,41 dc 00 00,41 d1 00 00'])
+
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ self.expect("frame variable intarr",
+ substrs = ['intarr = arr =',
+ '01 00 00 00,01 00 00 00,02 00 00 00,03 00 00 00,05 00 00 00'])
+ else:
+ self.expect("frame variable intarr",
+ substrs = ['intarr = arr =',
+ '00 00 00 01,00 00 00 01,00 00 00 02,00 00 00 03,00 00 00 05'])
+
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ self.expect("frame variable other.intarr",
+ substrs = ['intarr = arr = ',
+ '09 00 00 00,08 00 00 00,07 00 00 00,06 00 00 00,05 00 00 00'])
+ else:
+ self.expect("frame variable other.intarr",
+ substrs = ['intarr = arr = ',
+ '00 00 00 09,00 00 00 08,00 00 00 07,00 00 00 06,00 00 00 05'])
self.runCmd("type summary add --summary-string \"arr = ${var%Y}\" \"float [7]\"")
self.runCmd("type summary add --summary-string \"arr = ${var%Y}\" \"int [5]\"")
- self.expect("frame variable flarr",
- substrs = ['flarr = arr =',
- '00 00 9d 42 ...B,00 80 9a 42 ...B,00 00 9c 42 ...B,00 40 98 42 .@.B,00 80 99 42 ...B,00 c0 99 42 ...B,00 00 9a 42 ...B'])
-
- self.expect("frame variable other.flarr",
- substrs = ['flarr = arr =',
- '00 00 cc 41 ...A,00 00 ca 41 ...A,00 00 c9 41 ...A,00 00 d6 41 ...A,00 00 db 41 ...A,00 00 dc 41 ...A,00 00 d1 41 ...A'])
-
- self.expect("frame variable intarr",
- substrs = ['intarr = arr =',
- '....,01 00 00 00',
- '....,05 00 00 00'])
-
- self.expect("frame variable other.intarr",
- substrs = ['intarr = arr = ',
- '09 00 00 00',
- '....,07 00 00 00'])
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ self.expect("frame variable flarr",
+ substrs = ['flarr = arr =',
+ '00 00 9d 42 ...B,00 80 9a 42 ...B,00 00 9c 42 ...B,00 40 98 42 .@.B,00 80 99 42 ...B,00 c0 99 42 ...B,00 00 9a 42 ...B'])
+ else:
+ self.expect("frame variable flarr",
+ substrs = ['flarr = arr =',
+ '42 9d 00 00 B...,42 9a 80 00 B...,42 9c 00 00 B...,42 98 40 00 B.@.,42 99 80 00 B...,42 99 c0 00 B...,42 9a 00 00 B...'])
+
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ self.expect("frame variable other.flarr",
+ substrs = ['flarr = arr =',
+ '00 00 cc 41 ...A,00 00 ca 41 ...A,00 00 c9 41 ...A,00 00 d6 41 ...A,00 00 db 41 ...A,00 00 dc 41 ...A,00 00 d1 41 ...A'])
+ else:
+ self.expect("frame variable other.flarr",
+ substrs = ['flarr = arr =',
+ '41 cc 00 00 A...,41 ca 00 00 A...,41 c9 00 00 A...,41 d6 00 00 A...,41 db 00 00 A...,41 dc 00 00 A...,41 d1 00 00 A...'])
+
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ self.expect("frame variable intarr",
+ substrs = ['intarr = arr =',
+ '....,01 00 00 00',
+ '....,05 00 00 00'])
+ else:
+ self.expect("frame variable intarr",
+ substrs = ['intarr = arr =',
+ '....,00 00 00 01',
+ '....,00 00 00 05'])
+
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ self.expect("frame variable other.intarr",
+ substrs = ['intarr = arr = ',
+ '09 00 00 00',
+ '....,07 00 00 00'])
+ else:
+ self.expect("frame variable other.intarr",
+ substrs = ['intarr = arr = ',
+ '00 00 00 09',
+ '....,00 00 00 07'])