[pdbutil] Print the checksum hex string when using the '-lines' option

llvm-svn: 329707
This commit is contained in:
Aaron Smith 2018-04-10 14:47:12 +00:00
parent d6de5d70e8
commit 6db082393a
2 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,5 @@
; RUN: llvm-pdbutil pretty -lines %p/Inputs/PrettyFuncDumperTest.pdb > %t
; CHECK: ---COMPILANDS---
; CHECK: {{.*}}\PrettyFuncDumperTest.obj
; CHECK: {{.*}}\prettyfuncdumpertest.cpp (MD5: E36B273C4D7B3D70C996387C95A6C4F7)

View File

@ -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)