[Lldb-commits] [PATCH] D122856: [lldb] Refactor DataBuffer so we can map files as read-only

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 4 11:52:04 PDT 2022


JDevlieghere added inline comments.


================
Comment at: lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:361
   // Update the data to contain the entire file if it doesn't already
   if (data_sp->GetByteSize() < length) {
+    data_sp = MapFileDataWritable(*file, length, file_offset);
----------------
labath wrote:
> I guess this should be done unconditionally now.
No, I tried doing that actually and it broke a bunch of unit tests. I can take a look at it later this week if you think this is important. 


================
Comment at: lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:382
 ObjectFile *ObjectFileELF::CreateMemoryInstance(
     const lldb::ModuleSP &module_sp, DataBufferSP &data_sp,
     const lldb::ProcessSP &process_sp, lldb::addr_t header_addr) {
----------------
labath wrote:
> I am assuming this will always point to a writable kind of a data buffer. Could we change the prototype to reflect that?
Are you okay with making that a separate patch? 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122856/new/

https://reviews.llvm.org/D122856



More information about the lldb-commits mailing list