From 4a5ccd44d59a89cf47e9d2e09d477d9311312d81 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Sat, 15 Jul 2017 18:10:39 +0000 Subject: [PATCH] [CodeView] Dump BuildInfoSym and ProcSym type indices I need to print the type index in hex so that I can match it in FileCheck for a test I'm writing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308107 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/DebugInfo/CodeView/SymbolRecord.h | 2 +- lib/DebugInfo/CodeView/SymbolDumper.cpp | 2 +- test/DebugInfo/PDB/pdbdump-headers.test | 4 ++-- tools/llvm-pdbutil/MinimalSymbolDumper.cpp | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/llvm/DebugInfo/CodeView/SymbolRecord.h b/include/llvm/DebugInfo/CodeView/SymbolRecord.h index cdfc1745cea..f3086cf3dbb 100644 --- a/include/llvm/DebugInfo/CodeView/SymbolRecord.h +++ b/include/llvm/DebugInfo/CodeView/SymbolRecord.h @@ -848,7 +848,7 @@ public: : SymbolRecord(SymbolRecordKind::BuildInfoSym), RecordOffset(RecordOffset) {} - uint32_t BuildId; + TypeIndex BuildId; uint32_t RecordOffset; }; diff --git a/lib/DebugInfo/CodeView/SymbolDumper.cpp b/lib/DebugInfo/CodeView/SymbolDumper.cpp index c2c02f8de03..62e73acc72d 100644 --- a/lib/DebugInfo/CodeView/SymbolDumper.cpp +++ b/lib/DebugInfo/CodeView/SymbolDumper.cpp @@ -186,7 +186,7 @@ Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR, Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR, BuildInfoSym &BuildInfo) { - W.printNumber("BuildId", BuildInfo.BuildId); + printTypeIndex("BuildId", BuildInfo.BuildId); return Error::success(); } diff --git a/test/DebugInfo/PDB/pdbdump-headers.test b/test/DebugInfo/PDB/pdbdump-headers.test index 1887af2e826..037432682d4 100644 --- a/test/DebugInfo/PDB/pdbdump-headers.test +++ b/test/DebugInfo/PDB/pdbdump-headers.test @@ -472,13 +472,13 @@ ALL-NEXT: frontend = 18.0.31101.0, backend = 18.0.31101.0 ALL-NEXT: flags = security checks ALL-NEXT: 120 | S_GPROC32 [size = 44] `main` ALL-NEXT: parent = 0, end = 196, addr = 0001:0016, code size = 10 -ALL-NEXT: debug start = 3, debug end = 8, flags = has fp +ALL-NEXT: type = `0x1001 (int ())`, debug start = 3, debug end = 8, flags = has fp ALL-NEXT: 164 | S_FRAMEPROC [size = 32] ALL-NEXT: size = 0, padding size = 0, offset to padding = 0 ALL-NEXT: bytes of callee saved registers = 0, exception handler addr = 0000:0000 ALL-NEXT: flags = has async eh | opt speed ALL-NEXT: 196 | S_END [size = 4] -ALL-NEXT: 200 | S_BUILDINFO [size = 8] BuildId = `4110` +ALL-NEXT: 200 | S_BUILDINFO [size = 8] BuildId = `0x100E` ALL-NEXT: Mod 0001 | `* Linker *`: ALL-NEXT: 4 | S_OBJNAME [size = 20] sig=0, `* Linker *` ALL-NEXT: 24 | S_COMPILE3 [size = 48] diff --git a/tools/llvm-pdbutil/MinimalSymbolDumper.cpp b/tools/llvm-pdbutil/MinimalSymbolDumper.cpp index ab7045ca449..d93843649db 100644 --- a/tools/llvm-pdbutil/MinimalSymbolDumper.cpp +++ b/tools/llvm-pdbutil/MinimalSymbolDumper.cpp @@ -725,8 +725,9 @@ Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, ProcSym &Proc) { Proc.Parent, Proc.End, formatSegmentOffset(Proc.Segment, Proc.CodeOffset), Proc.CodeSize); - P.formatLine("debug start = {0}, debug end = {1}, flags = {2}", Proc.DbgStart, - Proc.DbgEnd, + // FIXME: It seems FunctionType is sometimes an id and sometimes a type. + P.formatLine("type = `{0}`, debug start = {1}, debug end = {2}, flags = {3}", + typeIndex(Proc.FunctionType), Proc.DbgStart, Proc.DbgEnd, formatProcSymFlags(P.getIndentLevel() + 9, Proc.Flags)); return Error::success(); } -- 2.50.0