================
@@ -482,6 +482,13 @@ size_t ObjectFile::CopyData(lldb::offset_t offset, size_t 
length,
   return m_data.CopyData(offset, length, dst);
 }
 
+llvm::ArrayRef<uint8_t> ObjectFile::PeekData(lldb::addr_t offset,
+                                             size_t length) const {
+  const uint8_t *data = m_data.PeekData(offset, length);
+  llvm::ArrayRef<uint8_t> array(data, length);
+  return array;
+}
+
----------------
labath wrote:

Could we avoid adding this function? You should be able access the same data 
using the `DataExtractor` overload of `GetData` (line 471, just call `GetData` 
on the returned DataExtractor), and this function is basically unimplementable 
for in-memory object files, which read their data on demand (as there's noone 
who can own the returned data).

(I realize this PR is not interested in those, but this API is going to be 
available for all object files)

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