================
@@ -1571,6 +1571,25 @@ class Process : public 
std::enable_shared_from_this<Process>,
   virtual size_t ReadMemory(lldb::addr_t vm_addr, void *buf, size_t size,
                             Status &error);
 
+  /// Read from multiple memory ranges and write the results into buffer.
+  ///
+  /// \param[in] ranges
+  ///     A collection of ranges (base address + size) to read from.
+  ///
+  /// \param[out] buffer
+  ///     A buffer where the read memory will be written to. It must be at 
least
----------------
felipepiovezan wrote:

> - the buffer provided by the caller is where all the results are stored

That's correct. A single buffer is provided, and a partition of that buffer is 
returned.

> then the Process::ReadMemoryRanges implementation is wrong. It's checking 
> each individual memory range size against buffer size,

I don't think this is correct (otherwise the tests would not have passed). The 
key line that you missed is probably this:

```
    buffer = buffer.drop_front(num_bytes_read);
```

https://github.com/llvm/llvm-project/pull/163651
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to