================
@@ -206,29 +206,34 @@ size_t ObjectFile::GetModuleSpecifications(const FileSpec 
&file,
                                            lldb::offset_t file_offset,
                                            lldb::offset_t file_size,
                                            ModuleSpecList &specs,
-                                           DataBufferSP data_sp) {
-  if (!data_sp)
-    data_sp = FileSystem::Instance().CreateDataBuffer(
+                                           DataExtractorSP extractor_sp) {
+  if (!extractor_sp)
+    extractor_sp = std::make_shared<DataExtractor>();
+  if (!extractor_sp->HasData()) {
+    DataBufferSP file_data_sp = FileSystem::Instance().CreateDataBuffer(
         file.GetPath(), g_initial_bytes_to_read, file_offset);
-  if (data_sp) {
+    if (file_data_sp)
+      extractor_sp->SetData(file_data_sp);
----------------
JDevlieghere wrote:

```suggestion
    if (DataBufferSP file_data_sp = 
FileSystem::Instance().CreateDataBuffer(file.GetPath(), 
g_initial_bytes_to_read, file_offset))
      extractor_sp->SetData(file_data_sp);
```

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

Reply via email to