[Lldb-commits] [lldb] [lldb][NFC] Module, ModuleSpec, GetSectionData use DataExtractorSP (PR #178347)

via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 28 14:50:06 PST 2026


================
@@ -97,9 +103,15 @@ ObjectFile *ObjectFileBreakpad::CreateMemoryInstance(
 }
 
 size_t ObjectFileBreakpad::GetModuleSpecifications(
-    const FileSpec &file, DataBufferSP &data_sp, offset_t data_offset,
+    const FileSpec &file, DataExtractorSP &extractor_sp, offset_t data_offset,
     offset_t file_offset, offset_t length, ModuleSpecList &specs) {
-  auto text = toStringRef(data_sp->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 =
----------------
jimingham wrote:

I think you meed to check that extractor_sp is not empty here as well.

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


More information about the lldb-commits mailing list