1 //===- PDBSymbolExe.cpp - ---------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
11 #include "llvm/DebugInfo/PDB/PDBExtras.h"
12 #include "llvm/DebugInfo/PDB/PDBSymbol.h"
13 #include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
14 #include "llvm/Support/ConvertUTF.h"
15 #include "llvm/Support/FileSystem.h"
16 #include "llvm/Support/raw_ostream.h"
21 PDBSymbolExe::PDBSymbolExe(const IPDBSession &PDBSession,
22 std::unique_ptr<IPDBRawSymbol> Symbol)
23 : PDBSymbol(PDBSession, std::move(Symbol)) {}
25 void PDBSymbolExe::dump(raw_ostream &OS, int Indent,
26 PDB_DumpLevel Level) const {
27 std::string FileName(getSymbolsFileName());
29 OS << stream_indent(Indent) << "Summary for " << FileName << "\n";
31 uint64_t FileSize = 0;
32 if (!llvm::sys::fs::file_size(FileName, FileSize))
33 OS << stream_indent(Indent + 2) << "Size: " << FileSize << " bytes\n";
35 OS << stream_indent(Indent + 2) << "Size: (Unable to obtain file size)\n";
36 PDB_UniqueId Guid = getGuid();
37 OS << stream_indent(Indent + 2) << "Guid: " << Guid << "\n";
38 OS << stream_indent(Indent + 2) << "Age: " << getAge() << "\n";
39 OS << stream_indent(Indent + 2) << "Attributes: ";
42 if (hasPrivateSymbols())
43 OS << "HasPrivateSymbols ";
47 auto ChildrenEnum = getChildStats(Stats);
48 OS << stream_indent(Indent + 2) << "Children: " << Stats << "\n";
49 while (auto Child = ChildrenEnum->getNext()) {
50 Child->dump(OS, Indent + 4, PDB_DumpLevel::Normal);