Skip to content

Commit 20e1732

Browse files
committed
[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.
1 parent ed40229 commit 20e1732

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,17 +1537,18 @@ def single_step_only_steps_one_instruction(
15371537
# variable value
15381538
if re.match("s390x", arch):
15391539
expected_step_count = 2
1540-
# ARM64 requires "4" instructions: 2 to compute the address (adrp, add),
1541-
# one to materialize the constant (mov) and the store
1540+
# ARM64 requires "4" instructions: 2 to compute the address (adrp,
1541+
# add), one to materialize the constant (mov) and the store. Once
1542+
# addresses and constants are materialized, only one instruction is
1543+
# needed.
15421544
if re.match("arm64", arch):
1543-
expected_step_count = 4
1544-
1545-
self.assertEqual(step_count, expected_step_count)
1546-
1547-
# ARM64: Once addresses and constants are materialized, only one
1548-
# instruction is needed.
1549-
if re.match("arm64", arch):
1550-
expected_step_count = 1
1545+
before_materialization_step_count = 4
1546+
after_matrialization_step_count = 1
1547+
self.assertIn(step_count, [before_materialization_step_count,
1548+
after_matrialization_step_count])
1549+
expected_step_count = after_matrialization_step_count
1550+
else:
1551+
self.assertEqual(step_count, expected_step_count)
15511552

15521553
# Verify we hit the next state.
15531554
args["expected_g_c1"] = "0"

0 commit comments

Comments
 (0)