From a703658ebc90b6fbf6d3de91e4de3e4924de7591 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Thu, 29 Sep 2016 23:48:21 +0000 Subject: [PATCH] Add some logging when trace is on. We're getting a bot failure on i386 that doesn't I can't reproduce locally. Hopefully this will help us catch the reason. llvm-svn: 282810 --- .../TestRegisterVariables.py | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py b/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py index 733340eda655..ea0658f680e6 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py +++ b/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py @@ -55,10 +55,12 @@ def is_variable_in_register(frame, var_name): return True -def is_struct_pointer_in_register(frame, var_name): +def is_struct_pointer_in_register(frame, var_name, trace): # Ensure we can lookup the variable. var = frame.FindVariable(var_name) - # print("\nchecking {}...".format(var_name)) + if trace: + print("\nchecking {}...".format(var_name)) + if var is None or not var.IsValid(): # print("{} cannot be found".format(var_name)) return False @@ -68,13 +70,16 @@ def is_struct_pointer_in_register(frame, var_name): value = var.GetValue() # print("checking value...") if value is None: - # print("value is invalid") + if trace: + print("value is invalid") return False - # else: - # print("value is {}".format(value)) + else: + if trace: + print("value is {}".format(value)) var_loc = var.GetLocation() - # print("checking location: {}".format(var_loc)) + if trace: + print("checking location: {}".format(var_loc)) if var_loc is None or var_loc.startswith("0x"): # The frame var is not in a register but rather a memory location. # print("frame var {} is not in a register".format(var_name)) @@ -94,6 +99,7 @@ class RegisterVariableTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @expectedFailureAll(compiler="clang", compiler_version=['<', '3.5']) + @expectedFailureAll(compiler="clang", archs=["i386"]) @expectedFailureAll( compiler="gcc", compiler_version=[ '>=', '4.8.2'], archs=[ @@ -108,6 +114,7 @@ class RegisterVariableTestCase(TestBase): # way. register_variables_count = 0 + print("Trace is: ", self.TraceOn()) self.build() exe = os.path.join(os.getcwd(), "a.out") self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) @@ -138,7 +145,7 @@ class RegisterVariableTestCase(TestBase): self.expect("expr a", VARIABLES_DISPLAYED_CORRECTLY, patterns=[re_expr_equals('int', 2)]) - if is_struct_pointer_in_register(frame, 'b'): + if is_struct_pointer_in_register(frame, 'b', self.TraceOn()): register_variables_count += 1 self.expect("expr b->m1", VARIABLES_DISPLAYED_CORRECTLY, patterns=[re_expr_equals('int', 3)]) @@ -160,7 +167,7 @@ class RegisterVariableTestCase(TestBase): # Try some variables that should be visible frame = self.dbg.GetSelectedTarget().GetProcess( ).GetSelectedThread().GetSelectedFrame() - if is_struct_pointer_in_register(frame, 'b'): + if is_struct_pointer_in_register(frame, 'b', self.TraceOn()): register_variables_count += 1 self.expect("expr b->m2", VARIABLES_DISPLAYED_CORRECTLY, patterns=[re_expr_equals('int', 5)])