================
@@ -70,24 +70,30 @@ ObjectFile *ObjectFileBreakpad::CreateInstance(const 
ModuleSP &module_sp,
     extractor_sp = std::make_shared<DataExtractor>(data_sp);
     data_offset = 0;
   }
-  auto text = toStringRef(extractor_sp->GetSharedDataBuffer()->GetData());
+  // If this is opearting on a VirtualDataExtractor, it can have
+  // gaps between valid bytes in the DataBuffer. We extract an
+  // ArrayRef of the raw bytes, and can segfault.
+  DataExtractorSP contiguous_extractor_sp =
+      extractor_sp->GetSubsetExtractorSP(0);
----------------
jasonmolenda wrote:

I was really tempted to add a `DataExtractor::GetContiguousDataExtractorSP()` 
which is equivalent, but it seemed like such a special one-off name, I 
hesitated.  I think it would be clearer to have a method like this, though.

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