Revert "[LoongArch] Eliminate the redundant sign extension of division (#107971)"
[llvm-project.git] / lldb / test / API / functionalities / gdb_remote_client / TestStopPCs.py
blobef28cc95f7ad4bf0bb120c2a0cc95d6ab56689ac
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 TestStopPCs(GDBRemoteTestBase):
9 @skipIfXmlSupportMissing
10 def test(self):
11 class MyResponder(MockGDBServerResponder):
12 def haltReason(self):
13 return "T02thread:1ff0d;threads:1ff0d,2ff0d;thread-pcs:10001bc00,10002bc00;"
15 def threadStopInfo(self, threadnum):
16 if threadnum == 0x1FF0D:
17 return "T02thread:1ff0d;threads:1ff0d,2ff0d;thread-pcs:10001bc00,10002bc00;"
18 if threadnum == 0x2FF0D:
19 return "T00thread:2ff0d;threads:1ff0d,2ff0d;thread-pcs:10001bc00,10002bc00;"
21 def qXferRead(self, obj, annex, offset, length):
22 if annex == "target.xml":
23 return (
24 """<?xml version="1.0"?>
25 <target version="1.0">
26 <architecture>i386:x86-64</architecture>
27 <feature name="org.gnu.gdb.i386.core">
28 <reg name="rip" bitsize="64" regnum="0" type="code_ptr" group="general"/>
29 </feature>
30 </target>""",
31 False,
33 else:
34 return None, False
36 self.server.responder = MyResponder()
37 target = self.dbg.CreateTarget("")
38 if self.TraceOn():
39 self.runCmd("log enable gdb-remote packets")
40 self.addTearDownHook(lambda: self.runCmd("log disable gdb-remote packets"))
41 process = self.connect(target)
43 self.assertEqual(process.GetNumThreads(), 2)
44 th0 = process.GetThreadAtIndex(0)
45 th1 = process.GetThreadAtIndex(1)
46 self.assertEqual(th0.GetThreadID(), 0x1FF0D)
47 self.assertEqual(th1.GetThreadID(), 0x2FF0D)
48 self.assertEqual(th0.GetFrameAtIndex(0).GetPC(), 0x10001BC00)
49 self.assertEqual(th1.GetFrameAtIndex(0).GetPC(), 0x10002BC00)