[Lldb-commits] [lldb] r340966 - Don't include the Age in the UUID for CvRecordPdb70 UUID records in minidump files for Apple vendors.

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 29 13:34:08 PDT 2018


Author: gclayton
Date: Wed Aug 29 13:34:08 2018
New Revision: 340966

URL: http://llvm.org/viewvc/llvm-project?rev=340966&view=rev
Log:
Don't include the Age in the UUID for CvRecordPdb70 UUID records in minidump files for Apple vendors.

The CvRecordPdb70 structure looks like:

struct CvRecordPdb70 {
  uint8_t Uuid[16];
  llvm::support::ulittle32_t Age;
  // char PDBFileName[];
};
We were including the "Age" in the UUID for Apple vedors which caused us to not be able to match the UUID to built binaries. The "Age" field is set to zero in breakpad minidump files for Apple targets. 

Differential Revision: https://reviews.llvm.org/D51442





Modified:
    lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp

Modified: lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp?rev=340966&r1=340965&r2=340966&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp (original)
+++ lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp Wed Aug 29 13:34:08 2018
@@ -80,8 +80,18 @@ UUID MinidumpParser::GetModuleUUID(const
     // PDB70 record
     const CvRecordPdb70 *pdb70_uuid = nullptr;
     Status error = consumeObject(cv_record, pdb70_uuid);
-    if (!error.Fail())
-      return UUID::fromData(pdb70_uuid, sizeof(*pdb70_uuid));
+    if (!error.Fail()) {
+      auto arch = GetArchitecture();
+      // For Apple targets we only need a 16 byte UUID so that we can match
+      // the UUID in the Module to actual UUIDs from the built binaries. The
+      // "Age" field is zero in breakpad minidump files for Apple targets, so
+      // we restrict the UUID to the "Uuid" field so we have a UUID we can use
+      // to match.
+      if (arch.GetTriple().getVendor() == llvm::Triple::Apple)
+        return UUID::fromData(pdb70_uuid->Uuid, sizeof(pdb70_uuid->Uuid));
+      else
+        return UUID::fromData(pdb70_uuid, sizeof(*pdb70_uuid));
+    }
   } else if (cv_signature == CvSignature::ElfBuildId)
     return UUID::fromData(cv_record);
 




More information about the lldb-commits mailing list