Revert "[LoongArch] Eliminate the redundant sign extension of division (#107971)"
[llvm-project.git] / lldb / test / API / functionalities / gdb_remote_client / TestThreadSelectionBug.py
blob6e233147ca9e4eb481a935eb124e295ea225d547
1 import lldb
2 from lldbsuite.test.lldbtest import *
3 from lldbsuite.test.decorators import *
4 from lldbsuite.test.gdbclientutils import *
5 from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase
8 class TestThreadSelectionBug(GDBRemoteTestBase):
9 def test(self):
10 class MyResponder(MockGDBServerResponder):
11 def cont(self):
12 # Simulate process stopping due to a raise(SIGINT)
13 return "T01reason:signal"
15 self.server.responder = MyResponder()
16 target = self.createTarget("a.yaml")
17 process = self.connect(target)
18 python_os_plugin_path = os.path.join(self.getSourceDir(), "operating_system.py")
19 command = "settings set target.process.python-os-plugin-path '{}'".format(
20 python_os_plugin_path
22 self.dbg.HandleCommand(command)
24 self.assertTrue(process, PROCESS_IS_VALID)
25 self.assertEqual(process.GetNumThreads(), 3)
27 # Verify our OS plug-in threads showed up
28 thread = process.GetThreadByID(0x1)
29 self.assertTrue(
30 thread.IsValid(),
31 "Make sure there is a thread 0x1 after we load the python OS plug-in",
33 thread = process.GetThreadByID(0x2)
34 self.assertTrue(
35 thread.IsValid(),
36 "Make sure there is a thread 0x2 after we load the python OS plug-in",
38 thread = process.GetThreadByID(0x3)
39 self.assertTrue(
40 thread.IsValid(),
41 "Make sure there is a thread 0x3 after we load the python OS plug-in",
44 # Verify that a thread other than 3 is selected.
45 thread = process.GetSelectedThread()
46 self.assertNotEqual(thread.GetThreadID(), 0x3)
48 # Verify that we select the thread backed by physical thread 1, rather
49 # than virtual thread 1. The mapping comes from the OS plugin, where we
50 # specified that thread 3 is backed by real thread 1.
51 process.Continue()
52 thread = process.GetSelectedThread()
53 self.assertEqual(thread.GetThreadID(), 0x3)