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
11 class MyResponder(MockGDBServerResponder
):
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":
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"/>
36 self
.server
.responder
= MyResponder()
37 target
= self
.dbg
.CreateTarget("")
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)