1 from __future__ import print_function
3 from lldbsuite.test.lldbtest import *
4 from lldbsuite.test.decorators import *
5 from gdbclientutils import *
7 class TestNoWatchpointSupportInfo(GDBRemoteTestBase):
9 @skipIfXmlSupportMissing
13 Test lldb's parsing of the <architecture> tag in the target.xml register
16 class MyResponder(MockGDBServerResponder):
19 return "T02thread:1ff0d;thread-pcs:10001bc00;"
21 def threadStopInfo(self, threadnum):
22 if threadnum == 0x1ff0d:
23 return "T02thread:1ff0d;thread-pcs:10001bc00;"
26 def setBreakpoint(self, packet):
27 if packet.startswith("Z2,"):
30 def qXferRead(self, obj, annex, offset, length):
31 if annex == "target.xml":
32 return """<?xml version="1.0"?>
33 <target version="1.0">
34 <architecture>i386:x86-64</architecture>
35 <feature name="org.gnu.gdb.i386.core">
36 <reg name="rip" bitsize="64" regnum="0" type="code_ptr" group="general"/>
42 self.server.responder = MyResponder()
44 self.runCmd("log enable gdb-remote packets")
46 lambda: self.runCmd("log disable gdb-remote packets"))
47 self.dbg.SetDefaultArchitecture("x86_64")
48 target = self.dbg.CreateTargetWithFileAndArch(None, None)
50 process = self.connect(target)
53 interp = self.dbg.GetCommandInterpreter()
54 result = lldb.SBCommandReturnObject()
55 interp.HandleCommand("target list", result)
56 print(result.GetOutput())
60 wp = target.WatchAddress(0x100, 8, False, True, err)
61 if self.TraceOn() and (err.Fail() or wp.IsValid == False):
62 strm = lldb.SBStream()
63 err.GetDescription(strm)
64 print("watchpoint failed: %s" % strm.GetData())
65 self.assertTrue(wp.IsValid())