From a952c49c2047c2506d7b313cbeff82843c775f7e Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Fri, 13 Feb 2015 07:40:03 +0000 Subject: llvm-pdbdump: Add more comprehensive dumping of symbol types. In particular this patch adds the ability to dump complete function signature information including argument types as correctly formatted strings. A side effect of this is that almost all symbol and meta types are now formatted. llvm-svn: 229076 --- llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp') diff --git a/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp b/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp index 4bd96080c7f..4ae48df2e8c 100644 --- a/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp +++ b/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp @@ -15,6 +15,7 @@ #include "llvm/DebugInfo/PDB/PDBSymbolFunc.h" #include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h" #include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h" +#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h" #include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h" #include "llvm/Support/Format.h" @@ -26,9 +27,8 @@ PDBSymbolFunc::PDBSymbolFunc(const IPDBSession &PDBSession, void PDBSymbolFunc::dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const { - if (Level == PDB_DumpLevel::Compact) { - OS << stream_indent(Indent); - + OS << stream_indent(Indent); + if (Level >= PDB_DumpLevel::Normal) { uint32_t FuncStart = getRelativeVirtualAddress(); uint32_t FuncEnd = FuncStart + getLength(); if (FuncStart == 0 && FuncEnd == 0) { @@ -53,6 +53,12 @@ void PDBSymbolFunc::dump(raw_ostream &OS, int Indent, OS << "(FPO)"; OS << " "; + uint32_t FuncSigId = getTypeId(); + if (auto FuncSig = Session.getConcreteSymbolById( + FuncSigId)) { + OS << "(" << FuncSig->getCallingConvention() << ") "; + } + uint32_t ClassId = getClassParentId(); if (ClassId != 0) { if (auto Class = Session.getSymbolById(ClassId)) { @@ -63,6 +69,7 @@ void PDBSymbolFunc::dump(raw_ostream &OS, int Indent, } } OS << getName(); - OS << "\n"; + } else { + OS << getName(); } } -- cgit v1.2.3