mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-14 15:39:00 +00:00
eb6ab04fb2
We were starting to get some name clashes between llvm-pdbdump and the common CodeView framework, so I took this opportunity to rename a bunch of files to more accurately describe their usage. This also helps in llvm-pdbdump to distinguish between different files and whether they are used for pretty dump mode or raw dump mode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291627 91177308-0d34-0410-b5e6-96231b3b80d8
42 lines
1.3 KiB
C++
42 lines
1.3 KiB
C++
//===- PrettyExternalSymbolDumper.cpp -------------------------- *- C++ *-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "PrettyExternalSymbolDumper.h"
|
|
#include "LinePrinter.h"
|
|
|
|
#include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
|
|
#include "llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h"
|
|
#include "llvm/Support/Format.h"
|
|
|
|
using namespace llvm;
|
|
using namespace llvm::pdb;
|
|
|
|
ExternalSymbolDumper::ExternalSymbolDumper(LinePrinter &P)
|
|
: PDBSymDumper(true), Printer(P) {}
|
|
|
|
void ExternalSymbolDumper::start(const PDBSymbolExe &Symbol) {
|
|
auto Vars = Symbol.findAllChildren<PDBSymbolPublicSymbol>();
|
|
while (auto Var = Vars->getNext())
|
|
Var->dump(*this);
|
|
}
|
|
|
|
void ExternalSymbolDumper::dump(const PDBSymbolPublicSymbol &Symbol) {
|
|
std::string LinkageName = Symbol.getName();
|
|
if (Printer.IsSymbolExcluded(LinkageName))
|
|
return;
|
|
|
|
Printer.NewLine();
|
|
uint64_t Addr = Symbol.getVirtualAddress();
|
|
|
|
Printer << "[";
|
|
WithColor(Printer, PDB_ColorItem::Address).get() << format_hex(Addr, 10);
|
|
Printer << "] ";
|
|
WithColor(Printer, PDB_ColorItem::Identifier).get() << LinkageName;
|
|
}
|