diff options
author | Miguel A. Arroyo <mayanez@users.noreply.github.com> | 2024-06-04 09:43:24 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-04 09:43:24 -0700 |
commit | 0cb66a7bd52ee51a6b43c42fec22082b26365e37 (patch) | |
tree | ed1ea6cb922d814f43738432b008eb630bd63830 /llvm/tools | |
parent | 188b1a54df9ff6c0b388269c2b95b71a0ae7801b (diff) | |
download | llvm-0cb66a7bd52ee51a6b43c42fec22082b26365e37.zip llvm-0cb66a7bd52ee51a6b43c42fec22082b26365e37.tar.gz llvm-0cb66a7bd52ee51a6b43c42fec22082b26365e37.tar.bz2 |
[llvm-readobj][COFF] Consistent PDBGUID Formatting (#94256)
## Consistent PDB GUID in `llvm-readobj`
Currently, the PDB GUID is shown as a byte array:
`PDBGUID: (D8 4C 88 D9 26 15 1F 11 4C 4C 44 20 50 44 42 2E)`
This is inconsistent with `llvm-pdbutil` (e.g. `llvm-pdbutil dump
--summary`) which shows it as a hexadecimal string.
Additionally, `yaml2obj` uses the same hexadecimal string format.
In general, the hexadecimal string is the common representation for PDB
GUIDs on Windows.
This PR changes it to be consistent as shown below:
`PDBGUID: {D9884CD8-1526-111F-4C4C-44205044422E}`
Diffstat (limited to 'llvm/tools')
-rw-r--r-- | llvm/tools/llvm-readobj/COFFDumper.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/tools/llvm-readobj/COFFDumper.cpp b/llvm/tools/llvm-readobj/COFFDumper.cpp index 32b1d6a..b104774 100644 --- a/llvm/tools/llvm-readobj/COFFDumper.cpp +++ b/llvm/tools/llvm-readobj/COFFDumper.cpp @@ -27,6 +27,7 @@ #include "llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h" #include "llvm/DebugInfo/CodeView/DebugLinesSubsection.h" #include "llvm/DebugInfo/CodeView/DebugStringTableSubsection.h" +#include "llvm/DebugInfo/CodeView/Formatters.h" #include "llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h" #include "llvm/DebugInfo/CodeView/Line.h" #include "llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h" @@ -793,7 +794,9 @@ void COFFDumper::printCOFFDebugDirectory() { DictScope PDBScope(W, "PDBInfo"); W.printHex("PDBSignature", DebugInfo->Signature.CVSignature); if (DebugInfo->Signature.CVSignature == OMF::Signature::PDB70) { - W.printBinary("PDBGUID", ArrayRef(DebugInfo->PDB70.Signature)); + W.printString( + "PDBGUID", + formatv("{0}", fmt_guid(DebugInfo->PDB70.Signature)).str()); W.printNumber("PDBAge", DebugInfo->PDB70.Age); W.printString("PDBFileName", PDBFileName); } |