[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 07b3e2c0c6.
This commit is contained in:
@@ -52,7 +52,6 @@ class ThreadAPITestCase(TestBase):
|
||||
self.build()
|
||||
self.validate_negative_indexing()
|
||||
|
||||
@expectedFailureAll(oslist=["windows"])
|
||||
def test_StepInstruction(self):
|
||||
"""Test that StepInstruction preserves the plan stack."""
|
||||
self.build()
|
||||
@@ -324,34 +323,40 @@ class ThreadAPITestCase(TestBase):
|
||||
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",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user