diff options
| author | David Spickett <david.spickett@linaro.org> | 2024-07-10 11:19:55 +0000 |
|---|---|---|
| committer | David Spickett <david.spickett@linaro.org> | 2024-07-10 11:22:07 +0000 |
| commit | 3e06392c7db0eacfca94a176d430d9988b3ffbd6 (patch) | |
| tree | 755787f5fe201d3e10f23410b57e717516c5ef92 /lldb/test/API/python_api/thread/TestThreadAPI.py | |
| parent | 85d6e3cac7150f32cdbe69194ee86747684b3cfa (diff) | |
[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 07b3e2c0c68b93a3d4d89426dc7fd14cc31ca6be.
Diffstat (limited to 'lldb/test/API/python_api/thread/TestThreadAPI.py')
| -rw-r--r-- | lldb/test/API/python_api/thread/TestThreadAPI.py | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/lldb/test/API/python_api/thread/TestThreadAPI.py b/lldb/test/API/python_api/thread/TestThreadAPI.py index a74302263aa4..1898c6a2a979 100644 --- a/lldb/test/API/python_api/thread/TestThreadAPI.py +++ b/lldb/test/API/python_api/thread/TestThreadAPI.py @@ -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", ) |
