Revert "[LoongArch] Eliminate the redundant sign extension of division (#107971)"
[llvm-project.git] / lldb / test / API / functionalities / gdb_remote_client / TestWriteMemory.py
blob6d850148e81a45ce7fb0c5d7a0be5aef40284466
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 TestWriteMemory(GDBRemoteTestBase):
9 def test(self):
10 class MyResponder(MockGDBServerResponder):
11 def setBreakpoint(self, packet):
12 return "OK"
14 self.server.responder = MyResponder()
15 target = self.dbg.CreateTargetWithFileAndTargetTriple("", "x86_64-pc-linux")
16 process = self.connect(target)
18 bp = target.BreakpointCreateByAddress(0x1000)
19 self.assertTrue(bp.IsValid())
20 self.assertEqual(bp.GetNumLocations(), 1)
21 bp.SetEnabled(True)
22 self.assertTrue(bp.IsEnabled())
24 err = lldb.SBError()
25 data = str("\x01\x02\x03\x04")
26 result = process.WriteMemory(0x1000, data, err)
27 self.assertEqual(result, 4)