[Lldb-commits] [lldb] 20e1732 - [lldb] Fix a few lldb-server tests on Apple Silicon

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 7 09:35:16 PST 2022


Author: Jonas Devlieghere
Date: 2022-02-07T09:35:12-08:00
New Revision: 20e17323cd90d04f38cf35d70a3b7cac37d2e15d

URL: https://github.com/llvm/llvm-project/commit/20e17323cd90d04f38cf35d70a3b7cac37d2e15d
DIFF: https://github.com/llvm/llvm-project/commit/20e17323cd90d04f38cf35d70a3b7cac37d2e15d.diff

LOG: [lldb] Fix a few lldb-server tests on Apple Silicon

This fixes TestGdbRemoteSingleStep.py and TestGdbRemote_vCont.py. This
patch updates the test to account for the possibility that the constants
are already materialized. This appears to behave differently between
embedded arm64 devices and Apple Silicon.

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
index ef67619e4835b..619d0f1c21729 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -1537,17 +1537,18 @@ def single_step_only_steps_one_instruction(
         # variable value
         if re.match("s390x", arch):
             expected_step_count = 2
-        # ARM64 requires "4" instructions: 2 to compute the address (adrp, add),
-        # one to materialize the constant (mov) and the store
+        # ARM64 requires "4" instructions: 2 to compute the address (adrp,
+        # add), one to materialize the constant (mov) and the store. Once
+        # addresses and constants are materialized, only one instruction is
+        # needed.
         if re.match("arm64", arch):
-            expected_step_count = 4
-
-        self.assertEqual(step_count, expected_step_count)
-
-        # ARM64: Once addresses and constants are materialized, only one
-        # instruction is needed.
-        if re.match("arm64", arch):
-            expected_step_count = 1
+            before_materialization_step_count = 4
+            after_matrialization_step_count = 1
+            self.assertIn(step_count, [before_materialization_step_count,
+                                       after_matrialization_step_count])
+            expected_step_count = after_matrialization_step_count
+        else:
+            self.assertEqual(step_count, expected_step_count)
 
         # Verify we hit the next state.
         args["expected_g_c1"] = "0"


        


More information about the lldb-commits mailing list