2015-02-08 08:29:29 +08:00
|
|
|
//===- PDBSymbolThunk.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>
|
|
|
|
|
|
|
|
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
|
|
|
|
#include "llvm/DebugInfo/PDB/PDBSymbolThunk.h"
|
|
|
|
|
2015-02-11 06:43:25 +08:00
|
|
|
#include "llvm/Support/Format.h"
|
|
|
|
|
2015-02-08 08:29:29 +08:00
|
|
|
using namespace llvm;
|
|
|
|
|
2015-02-09 06:53:53 +08:00
|
|
|
PDBSymbolThunk::PDBSymbolThunk(const IPDBSession &PDBSession,
|
2015-02-09 04:58:09 +08:00
|
|
|
std::unique_ptr<IPDBRawSymbol> Symbol)
|
2015-02-09 07:15:37 +08:00
|
|
|
: PDBSymbol(PDBSession, std::move(Symbol)) {}
|
2015-02-08 08:29:29 +08:00
|
|
|
|
2015-02-11 06:43:25 +08:00
|
|
|
void PDBSymbolThunk::dump(raw_ostream &OS, int Indent,
|
|
|
|
PDB_DumpLevel Level) const {
|
|
|
|
if (Level == PDB_DumpLevel::Compact) {
|
|
|
|
OS.indent(Indent);
|
|
|
|
PDB_ThunkOrdinal Ordinal = getThunkOrdinal();
|
|
|
|
OS << "THUNK[" << Ordinal << "] ";
|
|
|
|
OS << "[" << format_hex(getRelativeVirtualAddress(), 10);
|
|
|
|
if (Ordinal == PDB_ThunkOrdinal::TrampIncremental)
|
|
|
|
OS << " -> " << format_hex(getTargetRelativeVirtualAddress(), 10);
|
|
|
|
OS << "] ";
|
|
|
|
std::string Name = getName();
|
|
|
|
if (!Name.empty())
|
|
|
|
OS << Name;
|
|
|
|
OS << "\n";
|
|
|
|
}
|
|
|
|
}
|