diff options
Diffstat (limited to 'lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py')
| -rw-r--r-- | lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py b/lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py index fe78edd98f4d..e4997f0742d0 100644 --- a/lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py +++ b/lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py @@ -131,6 +131,26 @@ class PluginPythonOSPlugin(TestBase): "Make sure there is no thread 0x333333333 after we unload the python OS plug-in", ) + tid_regex = re.compile(r"tid = ((0x)?[0-9a-fA-F]+)") + + def get_tid_from_thread_info_command(self, thread, use_backing_thread): + interp = self.dbg.GetCommandInterpreter() + result = lldb.SBCommandReturnObject() + + backing_thread_arg = "" + if use_backing_thread: + backing_thread_arg = "--backing-thread" + + interp.HandleCommand( + "thread info {0} {1}".format(thread.GetIndexID(), backing_thread_arg), + result, + True, + ) + self.assertTrue(result.Succeeded(), "failed to run thread info") + match = self.tid_regex.search(result.GetOutput()) + self.assertNotEqual(match, None) + return int(match.group(1), 0) + def run_python_os_step(self): """Test that the Python operating system plugin works correctly and allows single stepping of a virtual thread that is backed by a real thread""" @@ -209,6 +229,11 @@ class PluginPythonOSPlugin(TestBase): # it to thread.StepOver() + tid_os = self.get_tid_from_thread_info_command(thread, False) + self.assertEqual(tid_os, 0x111111111) + tid_real = self.get_tid_from_thread_info_command(thread, True) + self.assertNotEqual(tid_os, tid_real) + frame = thread.GetFrameAtIndex(0) self.assertTrue( frame.IsValid(), "Make sure we get a frame from thread 0x111111111" |
