diff options
author | Zachary Turner <zturner@google.com> | 2015-02-13 01:23:51 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-02-13 01:23:51 +0000 |
commit | 2a5c0a27b6fe45e2c556ff94987be39220abfc09 (patch) | |
tree | 4e929c4b266057e95c1ebe19c28b94fc9d46b678 /llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp | |
parent | 54e2bc6c9b0047c3dbed74922d44e9e4e7b257cc (diff) | |
download | llvm-2a5c0a27b6fe45e2c556ff94987be39220abfc09.zip llvm-2a5c0a27b6fe45e2c556ff94987be39220abfc09.tar.gz llvm-2a5c0a27b6fe45e2c556ff94987be39220abfc09.tar.bz2 |
Improve llvm-pdbdump output display.
This patch adds a number of improvements to llvm-pdbdump.
1) Dumping of the entire global scope, and not only those
symbols that live in individual compilands.
2) Prepend class name to member functions and data
3) Improved display of bitfields.
4) Support for dumping more kinds of data symbols.
llvm-svn: 229012
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp b/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp index 17473c1..4bd9608 100644 --- a/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp +++ b/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp @@ -10,10 +10,12 @@ #include <utility> #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h" +#include "llvm/DebugInfo/PDB/IPDBSession.h" #include "llvm/DebugInfo/PDB/PDBSymbol.h" #include "llvm/DebugInfo/PDB/PDBSymbolFunc.h" #include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h" #include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h" +#include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h" #include "llvm/Support/Format.h" @@ -25,16 +27,23 @@ 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); + uint32_t FuncStart = getRelativeVirtualAddress(); uint32_t FuncEnd = FuncStart + getLength(); - OS << stream_indent(Indent); - OS << "[" << format_hex(FuncStart, 8); - if (auto DebugStart = findOneChild<PDBSymbolFuncDebugStart>()) - OS << "+" << DebugStart->getRelativeVirtualAddress() - FuncStart; - OS << " - " << format_hex(FuncEnd, 8); - if (auto DebugEnd = findOneChild<PDBSymbolFuncDebugEnd>()) + if (FuncStart == 0 && FuncEnd == 0) { + OS << "func [???]"; + } else { + OS << "func "; + OS << "[" << format_hex(FuncStart, 8); + if (auto DebugStart = findOneChild<PDBSymbolFuncDebugStart>()) + OS << "+" << DebugStart->getRelativeVirtualAddress() - FuncStart; + OS << " - " << format_hex(FuncEnd, 8); + if (auto DebugEnd = findOneChild<PDBSymbolFuncDebugEnd>()) OS << "-" << FuncEnd - DebugEnd->getRelativeVirtualAddress(); - OS << "] "; + OS << "] "; + } + PDB_RegisterId Reg = getLocalBasePointerRegisterId(); if (Reg == PDB_RegisterId::VFrame) OS << "(VFrame)"; @@ -42,6 +51,18 @@ void PDBSymbolFunc::dump(raw_ostream &OS, int Indent, OS << "(" << Reg << ")"; else OS << "(FPO)"; - OS << " " << getName() << "\n"; + + OS << " "; + uint32_t ClassId = getClassParentId(); + if (ClassId != 0) { + if (auto Class = Session.getSymbolById(ClassId)) { + if (auto UDT = dyn_cast<PDBSymbolTypeUDT>(Class.get())) + OS << UDT->getName() << "::"; + else + OS << "{class " << Class->getSymTag() << "}::"; + } + } + OS << getName(); + OS << "\n"; } } |