mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 19:12:56 +02:00
3d6950d915
Type records have a unique type index, but symbol records do not. Instead, symbol records refer to other symbol records by referencing their offset in the symbol stream. In a sense this is the analogue of the TypeIndex, but we are not printing it in the dumper. Printing it not only gives us more useful information when manually investigating the contents of a PDB, but also allows us to write better tests by enabling us to verify that fields that reference other symbol records do so correctly. Differential Revision: https://reviews.llvm.org/D34906 llvm-svn: 306890
48 lines
1.5 KiB
C++
48 lines
1.5 KiB
C++
//===- MinimalSymbolDumper.h ---------------------------------- *- C++ --*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_TOOLS_LLVMPDBUTIL_MINIMAL_SYMBOL_DUMPER_H
|
|
#define LLVM_TOOLS_LLVMPDBUTIL_MINIMAL_SYMBOL_DUMPER_H
|
|
|
|
#include "llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h"
|
|
|
|
namespace llvm {
|
|
namespace codeview {
|
|
class LazyRandomTypeCollection;
|
|
}
|
|
|
|
namespace pdb {
|
|
class LinePrinter;
|
|
|
|
class MinimalSymbolDumper : public codeview::SymbolVisitorCallbacks {
|
|
public:
|
|
MinimalSymbolDumper(LinePrinter &P, bool RecordBytes,
|
|
codeview::LazyRandomTypeCollection &Types)
|
|
: P(P), Types(Types) {}
|
|
|
|
Error visitSymbolBegin(codeview::CVSymbol &Record) override;
|
|
Error visitSymbolBegin(codeview::CVSymbol &Record, uint32_t Offset) override;
|
|
Error visitSymbolEnd(codeview::CVSymbol &Record) override;
|
|
|
|
#define SYMBOL_RECORD(EnumName, EnumVal, Name) \
|
|
virtual Error visitKnownRecord(codeview::CVSymbol &CVR, \
|
|
codeview::Name &Record) override;
|
|
#define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
|
|
#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
|
|
|
|
private:
|
|
std::string typeIndex(codeview::TypeIndex TI) const;
|
|
|
|
LinePrinter &P;
|
|
codeview::LazyRandomTypeCollection &Types;
|
|
};
|
|
} // namespace pdb
|
|
} // namespace llvm
|
|
|
|
#endif |