[Lldb-commits] [lldb] cd05406 - [testsuite] Adapt lldb-server base test helper to run on arm64

Davide Italiano via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 20 14:38:21 PDT 2020


Author: Davide Italiano
Date: 2020-07-20T14:38:13-07:00
New Revision: cd05406b105334b01f0eae141e7e05d6fb4a2ecb

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

LOG: [testsuite] Adapt lldb-server base test helper to run on arm64

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 d702d8ee6820..71e6fdd8857f 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,7 +1537,7 @@ def single_step_only_steps_one_instruction(
         g_c2_address = int(context.get("g_c2_address"), 16)
 
         # Set a breakpoint at the given address.
-        if self.getArchitecture() == "arm":
+        if self.getArchitecture().startswith("arm"):
             # TODO: Handle case when setting breakpoint in thumb code
             BREAKPOINT_KIND = 4
         else:
@@ -1601,8 +1601,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
+        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
+
         # Verify we hit the next state.
         args["expected_g_c1"] = "0"
         args["expected_g_c2"] = "0"


        


More information about the lldb-commits mailing list