[Lldb-commits] [lldb] r282810 - Add some logging when trace is on. We're getting a bot failure on i386 that doesn't

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 29 16:48:21 PDT 2016


Author: jingham
Date: Thu Sep 29 18:48:21 2016
New Revision: 282810

URL: http://llvm.org/viewvc/llvm-project?rev=282810&view=rev
Log:
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.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py?rev=282810&r1=282809&r2=282810&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py Thu Sep 29 18:48:21 2016
@@ -55,10 +55,12 @@ def is_variable_in_register(frame, var_n
         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,
     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)])




More information about the lldb-commits mailing list