[Lldb-commits] [lldb] [lldb][lldb-dap] Added support for "WriteMemory" request. (PR #131820)
Adrian Vogelsgesang via lldb-commits
lldb-commits at lists.llvm.org
Thu Mar 27 06:57:19 PDT 2025
================
@@ -112,3 +112,48 @@ def test_readMemory(self):
# Reads at offset 0x0 fail
mem = self.dap_server.request_readMemory("0x0", 0, 6)
self.assertEqual(mem["success"], False)
+
+ def test_writeMemory(self):
+ """
+ Tests the 'writeMemory' request
+ """
+ program = self.getBuildArtifact("a.out")
+ self.build_and_launch(program)
+ source = "main.cpp"
+ self.source_path = os.path.join(os.getcwd(), source)
+ self.set_source_breakpoints(
+ source,
+ [line_number(source, "// Breakpoint")],
+ )
+ self.continue_to_next_stop()
+
+ # Get the 'not_a_ptr' writable variablle reference address.
+ ptr_deref = self.dap_server.request_evaluate("not_a_ptr")["body"]
+ memref = ptr_deref["memoryReference"]
+
+ # Write the Base64-encoded string "Mg==", which decodes to binary 0x32
+ # which is decimal 50 and corresponds to the SCII character '2'.
----------------
vogelsgesang wrote:
```suggestion
# which is decimal 50 and corresponds to the ASCII character '2'.
```
https://github.com/llvm/llvm-project/pull/131820
More information about the lldb-commits
mailing list