Skip to content

Commit 3e06392

Browse files
committed
[lldb][test] Fix instruction test step on Windows
On Windows the function name is the full prototype including the calling convention, all we care about is that the last part is correct. This also reverts the xfail added by 07b3e2c.
1 parent 85d6e3c commit 3e06392

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

lldb/test/API/python_api/thread/TestThreadAPI.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def test_negative_indexing(self):
5252
self.build()
5353
self.validate_negative_indexing()
5454

55-
@expectedFailureAll(oslist=["windows"])
5655
def test_StepInstruction(self):
5756
"""Test that StepInstruction preserves the plan stack."""
5857
self.build()
@@ -324,34 +323,40 @@ def step_instruction_in_called_function(self):
324323
self.assertGreater(
325324
call_me_bkpt.GetNumLocations(), 0, "Got at least one location in call_me"
326325
)
326+
327+
# On Windows this may be the full name "void __cdecl call_me(bool)",
328+
# elsewhere it's just "call_me(bool)".
329+
expected_name = r".*call_me\(bool\)$"
330+
327331
# Now run the expression, this will fail because we stopped at a breakpoint:
328332
self.runCmd("expr -i 0 -- call_me(true)", check=False)
329333
# Now we should be stopped in call_me:
330-
self.assertEqual(
331-
thread.frames[0].name, "call_me(bool)", "Stopped in call_me(bool)"
334+
self.assertRegex(
335+
thread.frames[0].name, expected_name, "Stopped in call_me(bool)"
332336
)
337+
333338
# Now do a various API steps. These should not cause the expression context to get unshipped:
334339
thread.StepInstruction(False)
335-
self.assertEqual(
340+
self.assertRegex(
336341
thread.frames[0].name,
337-
"call_me(bool)",
342+
expected_name,
338343
"Still in call_me(bool) after StepInstruction",
339344
)
340345
thread.StepInstruction(True)
341-
self.assertEqual(
346+
self.assertRegex(
342347
thread.frames[0].name,
343-
"call_me(bool)",
348+
expected_name,
344349
"Still in call_me(bool) after NextInstruction",
345350
)
346351
thread.StepInto()
347-
self.assertEqual(
352+
self.assertRegex(
348353
thread.frames[0].name,
349-
"call_me(bool)",
354+
expected_name,
350355
"Still in call_me(bool) after StepInto",
351356
)
352357
thread.StepOver(False)
353-
self.assertEqual(
358+
self.assertRegex(
354359
thread.frames[0].name,
355-
"call_me(bool)",
360+
expected_name,
356361
"Still in call_me(bool) after StepOver",
357362
)

0 commit comments

Comments
 (0)