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

llvm-svn: 340966
This commit is contained in:
Greg Clayton 2018-08-29 20:34:08 +00:00
parent 9ff67a9dda
commit 77c57200f8
1 changed files with 12 additions and 2 deletions

View File

@ -80,8 +80,18 @@ UUID MinidumpParser::GetModuleUUID(const MinidumpModule *module) {
// PDB70 record
const CvRecordPdb70 *pdb70_uuid = nullptr;
Status error = consumeObject(cv_record, pdb70_uuid);
if (!error.Fail())
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);