From: Aaron Smith Date: Tue, 10 Apr 2018 14:47:12 +0000 (+0000) Subject: [pdbutil] Print the checksum hex string when using the '-lines' option X-Git-Tag: android-x86-7.1-r4~2522 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d9438b8809f22aeeb2120885844dc9830300a969;p=android-x86%2Fexternal-llvm.git [pdbutil] Print the checksum hex string when using the '-lines' option git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329707 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/tools/llvm-pdbdump/checksum-string.test b/test/tools/llvm-pdbdump/checksum-string.test new file mode 100644 index 00000000000..c3ecc265e9b --- /dev/null +++ b/test/tools/llvm-pdbdump/checksum-string.test @@ -0,0 +1,5 @@ +; RUN: llvm-pdbutil pretty -lines %p/Inputs/PrettyFuncDumperTest.pdb > %t + +; CHECK: ---COMPILANDS--- +; CHECK: {{.*}}\PrettyFuncDumperTest.obj +; CHECK: {{.*}}\prettyfuncdumpertest.cpp (MD5: E36B273C4D7B3D70C996387C95A6C4F7) diff --git a/tools/llvm-pdbutil/PrettyCompilandDumper.cpp b/tools/llvm-pdbutil/PrettyCompilandDumper.cpp index b19b09873be..0d99c9b1245 100644 --- a/tools/llvm-pdbutil/PrettyCompilandDumper.cpp +++ b/tools/llvm-pdbutil/PrettyCompilandDumper.cpp @@ -60,6 +60,12 @@ void CompilandDumper::start(const PDBSymbolCompiland &Symbol, while (auto File = Files->getNext()) { Printer.NewLine(); WithColor(Printer, PDB_ColorItem::Path).get() << File->getFileName(); + if (File->getChecksumType() != PDB_Checksum::None) { + auto ChecksumType = File->getChecksumType(); + auto ChecksumHexString = toHex(File->getChecksum()); + WithColor(Printer, PDB_ColorItem::Comment).get() + << " (" << ChecksumType << ": " << ChecksumHexString << ")"; + } auto Lines = Session.findLineNumbers(Symbol, *File); if (!Lines)