From f3fbd1c0586ff6ec7895991e6c28f61a503c36a8 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 23 Jul 2016 20:50:09 +0000 Subject: Vendor import of lldb release_39 branch r276489: https://llvm.org/svn/llvm-project/lldb/branches/release_39@276489 --- .../synthcapping/TestSyntheticCapping.py | 25 +++++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py') diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py index 0550f57ae62a..e8b6c1ad95f5 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py @@ -8,8 +8,9 @@ from __future__ import print_function import os, time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class SyntheticCappingTestCase(TestBase): @@ -30,6 +31,8 @@ class SyntheticCappingTestCase(TestBase): 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', @@ -51,25 +54,31 @@ class SyntheticCappingTestCase(TestBase): self.runCmd("script from fooSynthProvider import *") self.runCmd("type synth add -l fooSynthProvider foo") + # 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 the synthetic children work, so we know we are doing the right thing 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 capping works self.runCmd("settings set target.max-children-count 2", check=False) self.expect("frame variable f00_1", substrs = ['...', - 'fake_a = 16777216', - 'a = 0']); + 'fake_a = %d' % fake_a_val, + 'a = 1']); self.expect("frame variable f00_1", matching=False, - substrs = ['r = 33']); + substrs = ['r = 34']); self.runCmd("settings set target.max-children-count 256", check=False) self.expect("frame variable f00_1", matching=True, - substrs = ['r = 33']); + substrs = ['r = 34']); -- cgit v1.2.3