|
10 | 10 |
|
11 | 11 |
|
12 | 12 | class TestDAP_stepInTargets(lldbdap_testcase.DAPTestCaseBase):
|
13 |
| - @skipIf( |
14 |
| - archs=no_match(["x86_64"]) |
15 |
| - ) # InstructionControlFlowKind for ARM is not supported yet. |
| 13 | + @expectedFailureAll(oslist=["windows"]) |
| 14 | + @skipIf(archs=no_match(["x86_64"])) |
| 15 | + # InstructionControlFlowKind for ARM is not supported yet. |
| 16 | + # On Windows, lldb-dap seems to ignore targetId when stepping into functions. |
| 17 | + # For more context, see https://github.com/llvm/llvm-project/issues/98509. |
16 | 18 | def test_basic(self):
|
17 | 19 | """
|
18 | 20 | Tests the basic stepping in targets with directly calls.
|
@@ -55,14 +57,24 @@ def test_basic(self):
|
55 | 57 | self.assertEqual(len(step_in_targets), 3, "expect 3 step in targets")
|
56 | 58 |
|
57 | 59 | # Verify the target names are correct.
|
58 |
| - self.assertEqual(step_in_targets[0]["label"], "bar()", "expect bar()") |
59 |
| - self.assertEqual(step_in_targets[1]["label"], "bar2()", "expect bar2()") |
60 |
| - self.assertEqual( |
61 |
| - step_in_targets[2]["label"], "foo(int, int)", "expect foo(int, int)" |
62 |
| - ) |
| 60 | + # The order of funcA and funcB may change depending on the compiler ABI. |
| 61 | + funcA_target = None |
| 62 | + funcB_target = None |
| 63 | + for target in step_in_targets[0:2]: |
| 64 | + if "funcB" in target["label"]: |
| 65 | + funcB_target = target |
| 66 | + elif "funcA" in target["label"]: |
| 67 | + funcA_target = target |
| 68 | + else: |
| 69 | + self.fail(f"Unexpected step in target: {target}") |
| 70 | + |
| 71 | + self.assertIsNotNone(funcA_target, "expect funcA") |
| 72 | + self.assertIsNotNone(funcB_target, "expect funcB") |
| 73 | + self.assertIn("foo", step_in_targets[2]["label"], "expect foo") |
63 | 74 |
|
64 |
| - # Choose to step into second target and verify that we are in bar2() |
| 75 | + # Choose to step into second target and verify that we are in the second target, |
| 76 | + # be it funcA or funcB. |
65 | 77 | self.stepIn(threadId=tid, targetId=step_in_targets[1]["id"], waitForStop=True)
|
66 | 78 | leaf_frame = self.dap_server.get_stackFrame()
|
67 | 79 | self.assertIsNotNone(leaf_frame, "expect a leaf frame")
|
68 |
| - self.assertEqual(leaf_frame["name"], "bar2()") |
| 80 | + self.assertEqual(step_in_targets[1]["label"], leaf_frame["name"]) |
0 commit comments