[Lldb-commits] [lldb] Fix test assertions in TestDAP_stepInTargets.py (PR #96687)

Kendal Harland via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 9 16:26:12 PDT 2024


================
@@ -55,14 +55,23 @@ def test_basic(self):
         self.assertEqual(len(step_in_targets), 3, "expect 3 step in targets")
 
         # Verify the target names are correct.
-        self.assertEqual(step_in_targets[0]["label"], "bar()", "expect bar()")
-        self.assertEqual(step_in_targets[1]["label"], "bar2()", "expect bar2()")
-        self.assertEqual(
-            step_in_targets[2]["label"], "foo(int, int)", "expect foo(int, int)"
-        )
+        # The order of funcA and funcB may change depending on the compiler ABI.
+        funcA_target = None
+        funcB_target = None
+        for target in step_in_targets[0:2]:
+            if "funcB" in target["label"]:
+                funcB_target = target
+            elif "funcA" in target["label"]:
+                funcA_target = target
+            else:
+                self.fail(f"Unexpected step in target: {target}")
+
+        self.assertIsNotNone(funcA_target, "expect funcA")
+        self.assertIsNotNone(funcB_target, "expect funcB")
+        self.assertIn("foo", step_in_targets[2]["label"], "expect foo")
 
-        # Choose to step into second target and verify that we are in bar2()
-        self.stepIn(threadId=tid, targetId=step_in_targets[1]["id"], waitForStop=True)
+        # Choose to step into second target and verify that we are in funcB()
----------------
kendalharland wrote:

Thanks for the explanation! This sounds like the right thing to do, however I believe I'm hitting a bug: the test's DAP always steps into funcB regardless of the option passed to `targetId`.  Would you be able to reproduce this? If it reproduces for you, I wonder if this has always been broken, given that IIRC there's no Windows x64 CI and this test only runs when the architecture is x86_64.

https://github.com/llvm/llvm-project/pull/96687


More information about the lldb-commits mailing list