2015-02-08 00:29:29 +00:00
|
|
|
//===- PDBSymbolExe.cpp - ---------------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include <utility>
|
|
|
|
|
2015-02-10 22:43:25 +00:00
|
|
|
#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
|
|
|
|
#include "llvm/DebugInfo/PDB/PDBExtras.h"
|
2015-02-08 00:29:29 +00:00
|
|
|
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
|
|
|
|
#include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
|
|
|
|
#include "llvm/Support/ConvertUTF.h"
|
|
|
|
#include "llvm/Support/FileSystem.h"
|
|
|
|
#include "llvm/Support/raw_ostream.h"
|
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
2015-02-08 22:53:53 +00:00
|
|
|
PDBSymbolExe::PDBSymbolExe(const IPDBSession &PDBSession,
|
2015-02-08 20:58:09 +00:00
|
|
|
std::unique_ptr<IPDBRawSymbol> Symbol)
|
|
|
|
: PDBSymbol(PDBSession, std::move(Symbol)) {}
|
2015-02-08 00:29:29 +00:00
|
|
|
|
2015-02-10 22:43:25 +00:00
|
|
|
void PDBSymbolExe::dump(raw_ostream &OS, int Indent,
|
|
|
|
PDB_DumpLevel Level) const {
|
|
|
|
std::string FileName(getSymbolsFileName());
|
|
|
|
|
|
|
|
OS << "Summary for " << FileName << "\n";
|
|
|
|
|
|
|
|
uint64_t FileSize = 0;
|
|
|
|
if (!llvm::sys::fs::file_size(FileName, FileSize))
|
|
|
|
OS << " Size: " << FileSize << " bytes\n";
|
|
|
|
else
|
|
|
|
OS << " Size: (Unable to obtain file size)\n";
|
|
|
|
PDB_UniqueId Guid = getGuid();
|
|
|
|
OS << " Guid: " << Guid << "\n";
|
|
|
|
OS << " Age: " << getAge() << "\n";
|
|
|
|
OS << " Attributes: ";
|
|
|
|
if (hasCTypes())
|
|
|
|
OS << "HasCTypes ";
|
|
|
|
if (hasPrivateSymbols())
|
|
|
|
OS << "HasPrivateSymbols ";
|
|
|
|
OS << "\n";
|
2015-02-13 01:23:51 +00:00
|
|
|
|
|
|
|
TagStats Stats;
|
|
|
|
auto ChildrenEnum = getChildStats(Stats);
|
|
|
|
OS << stream_indent(Indent + 2) << "Children: " << Stats << "\n";
|
|
|
|
while (auto Child = ChildrenEnum->getNext()) {
|
|
|
|
Child->dump(OS, Indent+2, PDB_DumpLevel::Compact);
|
|
|
|
}
|
2015-02-08 00:29:29 +00:00
|
|
|
}
|