aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-02-15 20:27:53 +0000
committerZachary Turner <zturner@google.com>2015-02-15 20:27:53 +0000
commitc0acf6837b8f795d6afae2e06f1fcf96f7669084 (patch)
tree9b02d8de51c13b714d63bfbdcbb8a89bed4cdd75 /llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp
parent583089c6c67bba5222fc277f1e25dd349efa70bd (diff)
downloadllvm-c0acf6837b8f795d6afae2e06f1fcf96f7669084.zip
llvm-c0acf6837b8f795d6afae2e06f1fcf96f7669084.tar.gz
llvm-c0acf6837b8f795d6afae2e06f1fcf96f7669084.tar.bz2
llvm-pdbdump: Add flags controlling the type of values to dump.
llvm-svn: 229330
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp96
1 files changed, 44 insertions, 52 deletions
diff --git a/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp b/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp
index 817279b..cd01423 100644
--- a/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp
+++ b/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp
@@ -29,66 +29,58 @@ std::unique_ptr<PDBSymbolTypeFunctionSig> PDBSymbolFunc::getSignature() const {
}
void PDBSymbolFunc::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level) const {
+ PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
+ uint32_t FuncStart = getRelativeVirtualAddress();
+ uint32_t FuncEnd = FuncStart + getLength();
OS << stream_indent(Indent);
- // if (getName() == "__crtCreateThreadpoolWait") {
- // RawSymbol->dump(OS, Indent+2, Level);
- // OS.flush();
- //}
- if (Level >= PDB_DumpLevel::Normal) {
- uint32_t FuncStart = getRelativeVirtualAddress();
- uint32_t FuncEnd = FuncStart + getLength();
- 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 << "] ";
- }
+ 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 << "] ";
+ }
- PDB_RegisterId Reg = getLocalBasePointerRegisterId();
- if (Reg == PDB_RegisterId::VFrame)
- OS << "(VFrame)";
- else if (hasFramePointer())
- OS << "(" << Reg << ")";
- else
- OS << "(FPO)";
+ PDB_RegisterId Reg = getLocalBasePointerRegisterId();
+ if (Reg == PDB_RegisterId::VFrame)
+ OS << "(VFrame)";
+ else if (hasFramePointer())
+ OS << "(" << Reg << ")";
+ else
+ OS << "(FPO)";
- OS << " ";
- if (auto FuncSig = getSignature()) {
- // If we have a signature, dump the name with the signature.
- if (auto ReturnType = FuncSig->getReturnType()) {
- ReturnType->dump(OS, 0, PDB_DumpLevel::Compact);
- OS << " ";
- }
+ OS << " ";
+ if (isVirtual() || isPureVirtual())
+ OS << "virtual ";
- OS << FuncSig->getCallingConvention() << " ";
+ if (auto FuncSig = getSignature()) {
+ // If we have a signature, dump the name with the signature.
+ if (auto ReturnType = FuncSig->getReturnType()) {
+ ReturnType->dump(OS, 0, PDB_DumpLevel::Compact, PDB_DF_Children);
+ OS << " ";
+ }
- if (auto ClassParent = FuncSig->getClassParent()) {
- ClassParent->dump(OS, 0, PDB_DumpLevel::Compact);
- OS << "::";
- }
+ OS << FuncSig->getCallingConvention() << " ";
- OS << getName();
- FuncSig->dumpArgList(OS);
- } else {
- 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();
+ FuncSig->dumpArgList(OS);
+ if (isPureVirtual())
+ OS << " = 0";
+ } else {
+ 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();
}
- } else {
OS << getName();
}
}