[Lldb-commits] [lldb] [lldb-dap] Use protocol types for ReadMemory request (PR #144552)

John Harrison via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 17 09:49:47 PDT 2025


================
@@ -742,6 +742,42 @@ bool fromJSON(const llvm::json::Value &, DisassembledInstruction &,
               llvm::json::Path);
 llvm::json::Value toJSON(const DisassembledInstruction &);
 
+/// Arguments for `readMemory` request.
+struct ReadMemoryArguments {
+  /// Memory reference to the base location from which data should be read.
+  std::string memoryReference;
+
+  /// Offset (in bytes) to be applied to the reference location before reading
+  /// data. Can be negative.
+  std::optional<int64_t> offset;
----------------
ashgti wrote:

For simple values, like this, could we default to 0 and remove the optional? That makes it a little more straight forward to reason about when working with the type and we can not include the value if its 0 in the toJSON.

https://github.com/llvm/llvm-project/pull/144552


More information about the lldb-commits mailing list