[Lldb-commits] [lldb] 3e06392 - [lldb][test] Fix instruction test step on Windows

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 10 04:22:20 PDT 2024


Author: David Spickett
Date: 2024-07-10T11:22:07Z
New Revision: 3e06392c7db0eacfca94a176d430d9988b3ffbd6

URL: https://github.com/llvm/llvm-project/commit/3e06392c7db0eacfca94a176d430d9988b3ffbd6
DIFF: https://github.com/llvm/llvm-project/commit/3e06392c7db0eacfca94a176d430d9988b3ffbd6.diff

LOG: [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.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/python_api/thread/TestThreadAPI.py b/lldb/test/API/python_api/thread/TestThreadAPI.py
index a74302263aa45..1898c6a2a9792 100644
--- a/lldb/test/API/python_api/thread/TestThreadAPI.py
+++ b/lldb/test/API/python_api/thread/TestThreadAPI.py
@@ -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()
@@ -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",
         )


        


More information about the lldb-commits mailing list