Skip to content

Commit 3b1f907

Browse files
committed
Consistent PDBGUID Formatting
1 parent ffec63b commit 3b1f907

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

llvm/test/tools/llvm-readobj/COFF/debug-directory.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ CHECK: AddressOfRawData: 0x5B068
1212
CHECK: PointerToRawData: 0x5A268
1313
CHECK: PDBInfo {
1414
CHECK: PDBSignature: 0x53445352
15-
CHECK: PDBGUID: (96 83 40 42 81 07 9D 40 90 1B 4A 3C 0D 4F 56 32)
15+
CHECK: PDBGUID: {42408396-0781-409D-901B-4A3C0D4F5632}
1616
CHECK: PDBAge: 3
1717
CHECK: PDBFileName: D:\src\llvm\build\has_pdb.pdb
1818
CHECK: }

llvm/tools/llvm-readobj/COFFDumper.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h"
2828
#include "llvm/DebugInfo/CodeView/DebugLinesSubsection.h"
2929
#include "llvm/DebugInfo/CodeView/DebugStringTableSubsection.h"
30+
#include "llvm/DebugInfo/CodeView/Formatters.h"
3031
#include "llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h"
3132
#include "llvm/DebugInfo/CodeView/Line.h"
3233
#include "llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h"
@@ -793,7 +794,10 @@ void COFFDumper::printCOFFDebugDirectory() {
793794
DictScope PDBScope(W, "PDBInfo");
794795
W.printHex("PDBSignature", DebugInfo->Signature.CVSignature);
795796
if (DebugInfo->Signature.CVSignature == OMF::Signature::PDB70) {
796-
W.printBinary("PDBGUID", ArrayRef(DebugInfo->PDB70.Signature));
797+
SmallString<38> FormattedGUIDStr;
798+
raw_svector_ostream OS(FormattedGUIDStr);
799+
fmt_guid(DebugInfo->PDB70.Signature).format(OS, "" /*Style=unused*/);
800+
W.printString("PDBGUID", FormattedGUIDStr);
797801
W.printNumber("PDBAge", DebugInfo->PDB70.Age);
798802
W.printString("PDBFileName", PDBFileName);
799803
}

0 commit comments

Comments
 (0)