diff options
author | Zachary Turner <zturner@google.com> | 2015-02-13 07:40:03 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-02-13 07:40:03 +0000 |
commit | a952c49c2047c2506d7b313cbeff82843c775f7e (patch) | |
tree | 307e859f3f7e2105072e6912c99267cc1bd31d0a /llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp | |
parent | 383d7ae0bd01d92df28d8436fbd336186d8d499b (diff) | |
download | bcm5719-llvm-a952c49c2047c2506d7b313cbeff82843c775f7e.tar.gz bcm5719-llvm-a952c49c2047c2506d7b313cbeff82843c775f7e.zip |
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
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
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<PDBSymbolTypeFunctionSig>( + 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(); } } |