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/PDBSymbolCompiland.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/PDBSymbolCompiland.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp | 117 |
1 files changed, 61 insertions, 56 deletions
diff --git a/llvm/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp b/llvm/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp index 39bb9bc90f1..03ebe2b4d4b 100644 --- a/llvm/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp +++ b/llvm/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp @@ -29,70 +29,75 @@ PDBSymbolCompiland::PDBSymbolCompiland(const IPDBSession &PDBSession, void PDBSymbolCompiland::dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const { - std::string FullName = getName(); - StringRef Name = llvm::sys::path::filename(StringRef(FullName.c_str())); + if (Level == PDB_DumpLevel::Detailed) { + std::string FullName = getName(); + StringRef Name = llvm::sys::path::filename(StringRef(FullName.c_str())); - OS.indent(Indent); - OS << "Compiland: " << Name << "\n"; + OS.indent(Indent); + OS << "Compiland: " << Name << "\n"; - std::string Source = getSourceFileName(); - std::string Library = getLibraryName(); - if (!Source.empty()) - OS << stream_indent(Indent + 2) << "Source: " << this->getSourceFileName() - << "\n"; - if (!Library.empty()) - OS << stream_indent(Indent + 2) << "Library: " << this->getLibraryName() - << "\n"; + std::string Source = getSourceFileName(); + std::string Library = getLibraryName(); + if (!Source.empty()) + OS << stream_indent(Indent + 2) << "Source: " << this->getSourceFileName() + << "\n"; + if (!Library.empty()) + OS << stream_indent(Indent + 2) << "Library: " << this->getLibraryName() + << "\n"; - TagStats Stats; - auto ChildrenEnum = getChildStats(Stats); - OS << stream_indent(Indent + 2) << "Children: " << Stats << "\n"; - if (Level >= PDB_DumpLevel::Normal) { - while (auto Child = ChildrenEnum->getNext()) { - if (llvm::isa<PDBSymbolCompilandDetails>(*Child)) - continue; - if (llvm::isa<PDBSymbolCompilandEnv>(*Child)) - continue; - Child->dump(OS, Indent + 4, PDB_DumpLevel::Compact); + TagStats Stats; + auto ChildrenEnum = getChildStats(Stats); + OS << stream_indent(Indent + 2) << "Children: " << Stats << "\n"; + if (Level >= PDB_DumpLevel::Detailed) { + while (auto Child = ChildrenEnum->getNext()) { + if (llvm::isa<PDBSymbolCompilandDetails>(*Child)) + continue; + if (llvm::isa<PDBSymbolCompilandEnv>(*Child)) + continue; + PDB_DumpLevel ChildLevel = (Level == PDB_DumpLevel::Detailed) + ? PDB_DumpLevel::Normal + : PDB_DumpLevel::Compact; + Child->dump(OS, Indent + 4, ChildLevel); + OS << "\n"; + } } - } - auto DetailsEnum(findAllChildren<PDBSymbolCompilandDetails>()); - if (auto CD = DetailsEnum->getNext()) { - VersionInfo FE; - VersionInfo BE; - CD->getFrontEndVersion(FE); - CD->getBackEndVersion(BE); - OS << stream_indent(Indent + 2) << "Compiler: " << CD->getCompilerName() - << "\n"; - OS << stream_indent(Indent + 2) << "Version: " << FE << ", " << BE << "\n"; + auto DetailsEnum(findAllChildren<PDBSymbolCompilandDetails>()); + if (auto CD = DetailsEnum->getNext()) { + VersionInfo FE; + VersionInfo BE; + CD->getFrontEndVersion(FE); + CD->getBackEndVersion(BE); + OS << stream_indent(Indent + 2) << "Compiler: " << CD->getCompilerName() + << "\n"; + OS << stream_indent(Indent + 2) << "Version: " << FE << ", " << BE + << "\n"; - OS << stream_indent(Indent + 2) << "Lang: " << CD->getLanguage() << "\n"; - OS << stream_indent(Indent + 2) << "Attributes: "; - if (CD->hasDebugInfo()) - OS << "DebugInfo "; - if (CD->isDataAligned()) - OS << "DataAligned "; - if (CD->isLTCG()) - OS << "LTCG "; - if (CD->hasSecurityChecks()) - OS << "SecurityChecks "; - if (CD->isHotpatchable()) - OS << "HotPatchable"; + OS << stream_indent(Indent + 2) << "Lang: " << CD->getLanguage() << "\n"; + OS << stream_indent(Indent + 2) << "Attributes: "; + if (CD->hasDebugInfo()) + OS << "DebugInfo "; + if (CD->isDataAligned()) + OS << "DataAligned "; + if (CD->isLTCG()) + OS << "LTCG "; + if (CD->hasSecurityChecks()) + OS << "SecurityChecks "; + if (CD->isHotpatchable()) + OS << "HotPatchable"; - OS << "\n"; - auto Files(Session.getSourceFilesForCompiland(*this)); - if (Level >= PDB_DumpLevel::Detailed) { + auto Files(Session.getSourceFilesForCompiland(*this)); + OS << "\n"; OS << stream_indent(Indent + 2) << Files->getChildCount() - << " source files:\n"; - while (auto File = Files->getNext()) - File->dump(OS, Indent + 4, PDB_DumpLevel::Compact); - } else { - OS << stream_indent(Indent + 2) << Files->getChildCount() - << " source files\n"; + << " source files"; + } + uint32_t Count = DetailsEnum->getChildCount(); + if (Count > 1) { + OS << "\n"; + OS << stream_indent(Indent + 2) << "(" << Count - 1 << " more omitted)"; } + } else { + std::string FullName = getName(); + OS << stream_indent(Indent) << "Compiland: " << FullName; } - uint32_t Count = DetailsEnum->getChildCount(); - if (Count > 1) - OS << stream_indent(Indent + 2) << "(" << Count - 1 << " more omitted)\n"; } |