Skip to content

Commit 36b558e

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. (cherry picked from commit 20e1732)
1 parent a869925 commit 36b558e

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
@@ -1535,17 +1535,18 @@ def single_step_only_steps_one_instruction(
15351535
# variable value
15361536
if re.match("s390x", arch):
15371537
expected_step_count = 2
1538-
# ARM64 requires "4" instructions: 2 to compute the address (adrp, add),
1539-
# one to materialize the constant (mov) and the store
1538+
# ARM64 requires "4" instructions: 2 to compute the address (adrp,
1539+
# add), one to materialize the constant (mov) and the store. Once
1540+
# addresses and constants are materialized, only one instruction is
1541+
# needed.
15401542
if re.match("arm64", arch):
1541-
expected_step_count = 4
1542-
1543-
self.assertEqual(step_count, expected_step_count)
1544-
1545-
# ARM64: Once addresses and constants are materialized, only one
1546-
# instruction is needed.
1547-
if re.match("arm64", arch):
1548-
expected_step_count = 1
1543+
before_materialization_step_count = 4
1544+
after_matrialization_step_count = 1
1545+
self.assertIn(step_count, [before_materialization_step_count,
1546+
after_matrialization_step_count])
1547+
expected_step_count = after_matrialization_step_count
1548+
else:
1549+
self.assertEqual(step_count, expected_step_count)
15491550

15501551
# Verify we hit the next state.
15511552
args["expected_g_c1"] = "0"

0 commit comments

Comments
 (0)