[Lldb-commits] [lldb] [lldb] Add 'FindInMemory()' overload for PostMortemProcess. (PR #102536)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 8 22:45:02 PDT 2024


================
@@ -33,6 +34,23 @@ class PostMortemProcess : public Process {
   FileSpec GetCoreFile() const override { return m_core_file; }
 
 protected:
+  typedef lldb_private::Range<lldb::addr_t, lldb::addr_t> FileRange;
+  typedef lldb_private::RangeDataVector<lldb::addr_t, lldb::addr_t, FileRange>
+      VMRangeToFileOffset;
+  typedef lldb_private::RangeDataVector<lldb::addr_t, lldb::addr_t, uint32_t>
+      VMRangeToPermissions;
+
+  virtual const uint8_t *PeekMemory(lldb::addr_t low, lldb::addr_t high,
+                                    size_t &size) = 0;
----------------
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. Do we want to return a `std::optional<llvm::ArrayRef<uint8_t>>` where if something comes back with no value, then we know PeekMemory is not implemented and we can fall back to the original code?

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


More information about the lldb-commits mailing list