diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-08-09 00:25:12 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-08-09 00:25:12 +0000 |
commit | 015280211b091946b5ae33f2e5a056346068fe55 (patch) | |
tree | e7fde4fc7a05e21522cae8ac7a06550133e708c0 /llvm/tools/llvm-readobj/COFFDumper.cpp | |
parent | 06ba09af67300b8c727680e776bf14d3a47c306f (diff) | |
download | bcm5719-llvm-015280211b091946b5ae33f2e5a056346068fe55.tar.gz bcm5719-llvm-015280211b091946b5ae33f2e5a056346068fe55.zip |
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
Diffstat (limited to 'llvm/tools/llvm-readobj/COFFDumper.cpp')
-rw-r--r-- | llvm/tools/llvm-readobj/COFFDumper.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/tools/llvm-readobj/COFFDumper.cpp b/llvm/tools/llvm-readobj/COFFDumper.cpp index 28addfabd6e..529ebabaaf7 100644 --- a/llvm/tools/llvm-readobj/COFFDumper.cpp +++ b/llvm/tools/llvm-readobj/COFFDumper.cpp @@ -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. |