Skip to content

Commit

Permalink
[lldb][test] Fix instruction test step on Windows
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DavidSpickett committed Jul 10, 2024
1 parent 85d6e3c commit 3e06392
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions lldb/test/API/python_api/thread/TestThreadAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def test_negative_indexing(self):
self.build()
self.validate_negative_indexing()

@expectedFailureAll(oslist=["windows"])
def test_StepInstruction(self):
"""Test that StepInstruction preserves the plan stack."""
self.build()
Expand Down Expand Up @@ -324,34 +323,40 @@ def step_instruction_in_called_function(self):
self.assertGreater(
call_me_bkpt.GetNumLocations(), 0, "Got at least one location in call_me"
)

# On Windows this may be the full name "void __cdecl call_me(bool)",
# elsewhere it's just "call_me(bool)".
expected_name = r".*call_me\(bool\)$"

# Now run the expression, this will fail because we stopped at a breakpoint:
self.runCmd("expr -i 0 -- call_me(true)", check=False)
# Now we should be stopped in call_me:
self.assertEqual(
thread.frames[0].name, "call_me(bool)", "Stopped in call_me(bool)"
self.assertRegex(
thread.frames[0].name, expected_name, "Stopped in call_me(bool)"
)

# Now do a various API steps. These should not cause the expression context to get unshipped:
thread.StepInstruction(False)
self.assertEqual(
self.assertRegex(
thread.frames[0].name,
"call_me(bool)",
expected_name,
"Still in call_me(bool) after StepInstruction",
)
thread.StepInstruction(True)
self.assertEqual(
self.assertRegex(
thread.frames[0].name,
"call_me(bool)",
expected_name,
"Still in call_me(bool) after NextInstruction",
)
thread.StepInto()
self.assertEqual(
self.assertRegex(
thread.frames[0].name,
"call_me(bool)",
expected_name,
"Still in call_me(bool) after StepInto",
)
thread.StepOver(False)
self.assertEqual(
self.assertRegex(
thread.frames[0].name,
"call_me(bool)",
expected_name,
"Still in call_me(bool) after StepOver",
)

0 comments on commit 3e06392

Please sign in to comment.