================
@@ -669,6 +669,13 @@ class ObjectFile : public 
std::enable_shared_from_this<ObjectFile>,
   // transparent decompression of section contents.
   size_t CopyData(lldb::offset_t offset, size_t length, void *dst) const;
 
+  // Returns a pointer to the data at the specified offset. If the offset is
+  // invalid, this function will return nullptr. The 'available_bytes' argument
+  // will be set to the number of bytes available at the given offset, which
+  // will be at most 'length' bytes.
+  const uint8_t *PeekData(lldb::addr_t offset, size_t length,
+                          size_t &available_bytes) const;
+
----------------
clayborg wrote:

return `llvm::ArrayRef<uint8_t>` and get rid of the `size_t &available_bytes` 
parameter as the size of the returned ArrayRef will be sufficient. Also, please 
provide a default implementation that returns an empty array so subclasses that 
don't override this don't have to have change to their header and 
implementation file.

https://github.com/llvm/llvm-project/pull/102536
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to