CodeView: extract the OMF Directory Header
The DebugDirectory contains a pointer to the CodeView info structure which is a derivative of the OMF debug directory. The structure has evolved a bit over time, and PDB 2.0 used a slightly different definition from PDB 7.0. Both of these are specific to CodeView and not COFF. Reflect this by moving the structure definitions into the DebugInfo/CodeView headers. Define a generic DebugInfo union type that can be used to pass around a reference to the DebugInfo irrespective of the versioning. NFC. llvm-svn: 278075
This commit is contained in:
@@ -670,14 +670,16 @@ void COFFDumper::printCOFFDebugDirectory() {
|
||||
W.printHex("AddressOfRawData", D.AddressOfRawData);
|
||||
W.printHex("PointerToRawData", D.PointerToRawData);
|
||||
if (D.Type == COFF::IMAGE_DEBUG_TYPE_CODEVIEW) {
|
||||
const debug_pdb_info *PDBInfo;
|
||||
const codeview::DebugInfo *DebugInfo;
|
||||
StringRef PDBFileName;
|
||||
error(Obj->getDebugPDBInfo(&D, PDBInfo, PDBFileName));
|
||||
error(Obj->getDebugPDBInfo(&D, DebugInfo, PDBFileName));
|
||||
DictScope PDBScope(W, "PDBInfo");
|
||||
W.printHex("PDBSignature", PDBInfo->Signature);
|
||||
W.printBinary("PDBGUID", makeArrayRef(PDBInfo->Guid));
|
||||
W.printNumber("PDBAge", PDBInfo->Age);
|
||||
W.printString("PDBFileName", PDBFileName);
|
||||
W.printHex("PDBSignature", DebugInfo->Signature.CVSignature);
|
||||
if (DebugInfo->Signature.CVSignature == OMF::Signature::PDB70) {
|
||||
W.printBinary("PDBGUID", makeArrayRef(DebugInfo->PDB70.Signature));
|
||||
W.printNumber("PDBAge", DebugInfo->PDB70.Age);
|
||||
W.printString("PDBFileName", PDBFileName);
|
||||
}
|
||||
} else {
|
||||
// FIXME: Type values of 12 and 13 are commonly observed but are not in
|
||||
// the documented type enum. Figure out what they mean.
|
||||
|
||||
Reference in New Issue
Block a user