[lldb] [llvm] [LLDB][Minidump] Make workaround for the Dynamic loader issue (PR #120166)

Pavel Labath via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 23 04:56:12 PST 2024


================
@@ -354,6 +354,39 @@ DataExtractor ProcessMinidump::GetAuxvData() {
                        GetAddressByteSize(), GetAddressByteSize());
 }
 
+bool ProcessMinidump::IsLLDBMinidump() {
+  // If we've already checked, return the cached value
+  if (m_is_lldb_generated.has_value())
+    return *m_is_lldb_generated;
+
+  // If the minidump doesn't have a LLDBGeneratedStream, it's not an LLDB
+  // We also check to see if the section was generated correctly, but not
+  // enforcing an exact size so we can change it in the future without
+  // impacting older generated Minidumps.
+  llvm::ArrayRef<uint8_t> lldbStream =
+      m_minidump_parser->GetStream(StreamType::LLDBGenerated);
+  if (lldbStream.empty() || lldbStream.size() <= sizeof(StreamType)) {
----------------
labath wrote:

```suggestion
  if (lldbStream.size() < sizeof(StreamType)) {
```
`empty` is subsumed by the size check, and I think you need a strict comparison here.

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


More information about the llvm-commits mailing list