Rewrite llvm-pdbdump in terms of LLVMDebugInfoPDB.

This makes llvm-pdbdump available on all platforms, although it
will currently fail to create a dumper if there is no PDB reader
implementation for the current platform.

It implements dumping of compilands and children, which is less
information than was previously available, but it has to be
rewritten from scratch using the new set of interfaces, so the
rest of the functionality will be added back in subsequent commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228755 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Zachary Turner
2015-02-10 22:43:25 +00:00
parent f2138c2df8
commit 1e70854148
90 changed files with 1046 additions and 2338 deletions

View File

@@ -19,8 +19,12 @@ class DIARawSymbol : public IPDBRawSymbol {
public:
DIARawSymbol(const DIASession &PDBSession, CComPtr<IDiaSymbol> DiaSymbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
CComPtr<IDiaSymbol> getDiaSymbol() const { return Symbol; }
std::unique_ptr<IPDBEnumSymbols>
DIARawSymbol::findChildren(PDB_SymType Type) const override;
std::unique_ptr<IPDBEnumSymbols>
findChildren(PDB_SymType Type, StringRef Name,
PDB_NameSearchFlags Flags) const override;
@@ -54,7 +58,7 @@ public:
uint32_t getLiveRangeStartAddressOffset() const override;
uint32_t getLiveRangeStartAddressSection() const override;
uint32_t getLiveRangeStartRelativeVirtualAddress() const override;
uint32_t getLocalBasePointerRegisterId() const override;
PDB_RegisterId getLocalBasePointerRegisterId() const override;
uint32_t getLowerBoundId() const override;
uint32_t getMemorySpaceKind() const override;
std::string getName() const override;
@@ -69,7 +73,7 @@ public:
uint32_t getOffsetInUdt() const override;
PDB_Cpu getPlatform() const override;
uint32_t getRank() const override;
uint32_t getRegisterId() const override;
PDB_RegisterId getRegisterId() const override;
uint32_t getRegisterType() const override;
uint32_t getRelativeVirtualAddress() const override;
uint32_t getSamplerSlot() const override;
@@ -129,6 +133,7 @@ public:
bool hasInlAsm() const override;
bool hasInlineAttribute() const override;
bool hasInterruptReturn() const override;
bool hasFramePointer() const override;
bool hasLongJump() const override;
bool hasManagedCode() const override;
bool hasNestedTypes() const override;

View File

@@ -25,6 +25,10 @@ public:
void setLoadAddress(uint64_t Address) override;
std::unique_ptr<PDBSymbolExe> getGlobalScope() const override;
std::unique_ptr<PDBSymbol> getSymbolById(uint32_t SymbolId) const override;
std::unique_ptr<IPDBEnumSourceFiles> getAllSourceFiles() const override;
std::unique_ptr<IPDBEnumSourceFiles> getSourceFilesForCompiland(
const PDBSymbolCompiland &Compiland) const override;
std::unique_ptr<IPDBSourceFile>
getSourceFileById(uint32_t FileId) const override;

View File

@@ -29,7 +29,10 @@ class IPDBRawSymbol {
public:
virtual ~IPDBRawSymbol();
virtual void dump(llvm::raw_ostream &OS) const = 0;
virtual void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const = 0;
virtual std::unique_ptr<IPDBEnumSymbols>
findChildren(PDB_SymType Type) const = 0;
virtual std::unique_ptr<IPDBEnumSymbols>
findChildren(PDB_SymType Type, StringRef Name,
@@ -64,7 +67,7 @@ public:
virtual uint32_t getLiveRangeStartAddressOffset() const = 0;
virtual uint32_t getLiveRangeStartAddressSection() const = 0;
virtual uint32_t getLiveRangeStartRelativeVirtualAddress() const = 0;
virtual uint32_t getLocalBasePointerRegisterId() const = 0;
virtual PDB_RegisterId getLocalBasePointerRegisterId() const = 0;
virtual uint32_t getLowerBoundId() const = 0;
virtual uint32_t getMemorySpaceKind() const = 0;
virtual std::string getName() const = 0;
@@ -79,7 +82,7 @@ public:
virtual uint32_t getOffsetInUdt() const = 0;
virtual PDB_Cpu getPlatform() const = 0;
virtual uint32_t getRank() const = 0;
virtual uint32_t getRegisterId() const = 0;
virtual PDB_RegisterId getRegisterId() const = 0;
virtual uint32_t getRegisterType() const = 0;
virtual uint32_t getRelativeVirtualAddress() const = 0;
virtual uint32_t getSamplerSlot() const = 0;
@@ -136,6 +139,7 @@ public:
virtual bool hasDebugInfo() const = 0;
virtual bool hasEH() const = 0;
virtual bool hasEHa() const = 0;
virtual bool hasFramePointer() const = 0;
virtual bool hasInlAsm() const = 0;
virtual bool hasInlineAttribute() const = 0;
virtual bool hasInterruptReturn() const = 0;

View File

@@ -16,6 +16,7 @@
namespace llvm {
class PDBSymbolCompiland;
class PDBSymbolExe;
/// IPDBSession defines an interface used to provide a context for querying
@@ -28,6 +29,10 @@ public:
virtual void setLoadAddress(uint64_t Address) = 0;
virtual std::unique_ptr<PDBSymbolExe> getGlobalScope() const = 0;
virtual std::unique_ptr<PDBSymbol> getSymbolById(uint32_t SymbolId) const = 0;
virtual std::unique_ptr<IPDBEnumSourceFiles> getAllSourceFiles() const = 0;
virtual std::unique_ptr<IPDBEnumSourceFiles>
getSourceFilesForCompiland(const PDBSymbolCompiland &Compiland) const = 0;
virtual std::unique_ptr<IPDBSourceFile>
getSourceFileById(uint32_t FileId) const = 0;

View File

@@ -17,12 +17,16 @@
namespace llvm {
class raw_ostream;
/// IPDBSourceFile defines an interface used to represent source files whose
/// information are stored in the PDB.
class IPDBSourceFile {
public:
virtual ~IPDBSourceFile();
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const;
virtual std::string getFileName() const = 0;
virtual uint32_t getUniqueId() const = 0;
virtual std::string getChecksum() const = 0;

View File

@@ -0,0 +1,39 @@
//===- PDBExtras.h - helper functions and classes for PDBs -------*- C++-*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_DEBUGINFO_PDB_PDBEXTRAS_H
#define LLVM_DEBUGINFO_PDB_PDBEXTRAS_H
#include <unordered_map>
#include "PDBTypes.h"
#include "llvm/Support/raw_ostream.h"
namespace llvm {
typedef std::unordered_map<PDB_SymType, int> TagStats;
struct stream_indent {
stream_indent(int IndentWidth) : Width(IndentWidth) {}
int Width;
};
raw_ostream &operator<<(raw_ostream &OS, const stream_indent &Indent);
raw_ostream &operator<<(raw_ostream &OS, const PDB_RegisterId &Reg);
raw_ostream &operator<<(raw_ostream &OS, const PDB_LocType &Loc);
raw_ostream &operator<<(raw_ostream &OS, const PDB_ThunkOrdinal &Thunk);
raw_ostream &operator<<(raw_ostream &OS, const PDB_Checksum &Checksum);
raw_ostream &operator<<(raw_ostream &OS, const PDB_Lang &Lang);
raw_ostream &operator<<(raw_ostream &OS, const PDB_SymType &Tag);
raw_ostream &operator<<(raw_ostream &OS, const PDB_UniqueId &Id);
raw_ostream &operator<<(raw_ostream &OS, const VersionInfo &Version);
raw_ostream &operator<<(raw_ostream &OS, const TagStats &Stats);
}
#endif

View File

@@ -11,11 +11,13 @@
#define LLVM_DEBUGINFO_PDB_IPDBSYMBOL_H
#include <memory>
#include <unordered_map>
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Casting.h"
#include "IPDBRawSymbol.h"
#include "PDBExtras.h"
#include "PDBTypes.h"
#define FORWARD_SYMBOL_METHOD(MethodName) \
@@ -48,10 +50,12 @@ public:
/// call dump() on the underlying RawSymbol, which allows us to discover
/// unknown properties, but individual implementations of PDBSymbol may
/// override the behavior to only dump known fields.
virtual void dump(llvm::raw_ostream &OS) const;
virtual void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const = 0;
void defaultDump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const;
PDB_SymType getSymTag() const;
std::unique_ptr<IPDBEnumSymbols> findChildren(PDB_SymType Type) const;
std::unique_ptr<IPDBEnumSymbols>
findChildren(PDB_SymType Type, StringRef Name,
PDB_NameSearchFlags Flags) const;
@@ -61,7 +65,12 @@ public:
uint32_t RVA) const;
std::unique_ptr<IPDBEnumSymbols> findInlineFramesByRVA(uint32_t RVA) const;
const IPDBRawSymbol &getRawSymbol() const { return *RawSymbol; }
IPDBRawSymbol &getRawSymbol() { return *RawSymbol; }
protected:
std::unique_ptr<IPDBEnumSymbols> getChildStats(TagStats &Stats) const;
const IPDBSession &Session;
const std::unique_ptr<IPDBRawSymbol> RawSymbol;
};

View File

@@ -23,7 +23,7 @@ public:
PDBSymbolAnnotation(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAddressOffset)
FORWARD_SYMBOL_METHOD(getAddressSection)

View File

@@ -23,7 +23,7 @@ public:
PDBSymbolBlock(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAddressOffset)
FORWARD_SYMBOL_METHOD(getAddressSection)

View File

@@ -23,7 +23,7 @@ public:
PDBSymbolCompiland(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> CompilandSymbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(isEditAndContinueEnabled)
FORWARD_SYMBOL_METHOD(getLexicalParentId)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolCompilandDetails(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
void getFrontEndVersion(VersionInfo &Version) const {
RawSymbol->getFrontEndVersion(Version);

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolCompilandEnv(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getLexicalParentId)
FORWARD_SYMBOL_METHOD(getName)

View File

@@ -27,7 +27,7 @@ public:
PDBSymbolCustom(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> CustomSymbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
void getDataBytes(llvm::SmallVector<uint8_t, 32> &bytes);
FORWARD_SYMBOL_METHOD(getSymIndexId)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolData(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> DataSymbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAccess)
FORWARD_SYMBOL_METHOD(getAddressOffset)

View File

@@ -24,7 +24,7 @@ public:
PDBSymbolExe(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> ExeSymbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAge)
FORWARD_SYMBOL_METHOD(getGuid)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolFunc(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> FuncSymbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAccess)
FORWARD_SYMBOL_METHOD(getAddressOffset)
@@ -46,8 +46,10 @@ public:
FORWARD_SYMBOL_METHOD(isStatic)
FORWARD_SYMBOL_METHOD(getLength)
FORWARD_SYMBOL_METHOD(getLexicalParentId)
FORWARD_SYMBOL_METHOD(getLocalBasePointerRegisterId)
FORWARD_SYMBOL_METHOD(getLocationType)
FORWARD_SYMBOL_METHOD(getName)
FORWARD_SYMBOL_METHOD(hasFramePointer)
FORWARD_SYMBOL_METHOD(hasNoInlineAttribute)
FORWARD_SYMBOL_METHOD(hasNoReturnAttribute)
FORWARD_SYMBOL_METHOD(isUnreached)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolFuncDebugEnd(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> FuncDebugEndSymbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAddressOffset)
FORWARD_SYMBOL_METHOD(getAddressSection)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolFuncDebugStart(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> FuncDebugStartSymbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAddressOffset)
FORWARD_SYMBOL_METHOD(getAddressSection)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolLabel(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> LabelSymbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAddressOffset)
FORWARD_SYMBOL_METHOD(getAddressSection)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolPublicSymbol(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> PublicSymbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAddressOffset)
FORWARD_SYMBOL_METHOD(getAddressSection)

View File

@@ -24,7 +24,7 @@ public:
PDBSymbolThunk(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> ThunkSymbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAccess)
FORWARD_SYMBOL_METHOD(getAddressOffset)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolTypeArray(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> ArrayTypeSymbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getArrayIndexTypeId)
FORWARD_SYMBOL_METHOD(isConstType)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolTypeBaseClass(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getAccess)
FORWARD_SYMBOL_METHOD(getClassParentId)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolTypeBuiltin(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getBuiltinType)
FORWARD_SYMBOL_METHOD(isConstType)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolTypeCustom(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getOemId)
FORWARD_SYMBOL_METHOD(getOemSymbolId)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolTypeDimension(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getLowerBoundId)
FORWARD_SYMBOL_METHOD(getUpperBoundId)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolTypeEnum(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> EnumTypeSymbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getBuiltinType)
FORWARD_SYMBOL_METHOD(getClassParentId)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolTypeFriend(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getClassParentId)
FORWARD_SYMBOL_METHOD(getName)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolTypeFunctionArg(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getClassParentId)
FORWARD_SYMBOL_METHOD(getLexicalParentId)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolTypeFunctionSig(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getCallingConvention)
FORWARD_SYMBOL_METHOD(getClassParentId)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolTypeManaged(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getName)
FORWARD_SYMBOL_METHOD(getSymIndexId)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolTypePointer(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(isConstType)
FORWARD_SYMBOL_METHOD(getLength)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolTypeTypedef(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getBuiltinType)
FORWARD_SYMBOL_METHOD(getClassParentId)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolTypeUDT(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> UDTSymbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getClassParentId)
FORWARD_SYMBOL_METHOD(hasConstructor)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolTypeVTable(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> VtblSymbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getClassParentId)
FORWARD_SYMBOL_METHOD(isConstType)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolTypeVTableShape(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> VtblShapeSymbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(isConstType)
FORWARD_SYMBOL_METHOD(getCount)

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolUnknown(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> UnknownSymbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
static bool classof(const PDBSymbol *S) {
return (S->getSymTag() == PDB_SymType::None ||

View File

@@ -22,7 +22,7 @@ public:
PDBSymbolUsingNamespace(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol);
void dump(llvm::raw_ostream &OS) const override;
void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
FORWARD_SYMBOL_METHOD(getLexicalParentId)
FORWARD_SYMBOL_METHOD(getName)

View File

@@ -11,6 +11,7 @@
#define LLVM_DEBUGINFO_PDB_PDBTYPES_H
#include <stdint.h>
#include <functional>
#include "llvm/Config/llvm-config.h"
namespace llvm {
@@ -68,6 +69,12 @@ enum class PDB_ReaderType {
DIA = 0,
};
enum class PDB_DumpLevel {
Compact,
Normal,
Detailed,
};
/// Defines a 128-bit unique identifier. This maps to a GUID on Windows, but
/// is abstracted here for the purposes of non-Windows platforms that don't have
/// the GUID structure defined.
@@ -365,6 +372,58 @@ enum class PDB_BuiltinType {
HResult = 31
};
enum class PDB_RegisterId {
Unknown = 0,
VFrame = 30006,
AL = 1,
CL = 2,
DL = 3,
BL = 4,
AH = 5,
CH = 6,
DH = 7,
BH = 8,
AX = 9,
CX = 10,
DX = 11,
BX = 12,
SP = 13,
BP = 14,
SI = 15,
DI = 16,
EAX = 17,
ECX = 18,
EDX = 19,
EBX = 20,
ESP = 21,
EBP = 22,
ESI = 23,
EDI = 24,
ES = 25,
CS = 26,
SS = 27,
DS = 28,
FS = 29,
GS = 30,
IP = 31,
RAX = 328,
RBX = 329,
RCX = 330,
RDX = 331,
RSI = 332,
RDI = 333,
RBP = 334,
RSP = 335,
R8 = 336,
R9 = 337,
R10 = 338,
R11 = 339,
R12 = 340,
R13 = 341,
R14 = 342,
R15 = 343,
};
enum class PDB_MemberAccess { Private = 1, Protected = 2, Public = 3 };
struct VersionInfo {
@@ -376,4 +435,15 @@ struct VersionInfo {
} // namespace llvm
namespace std {
template <> struct hash<llvm::PDB_SymType> {
typedef llvm::PDB_SymType argument_type;
typedef std::size_t result_type;
result_type operator()(const argument_type &Arg) const {
return std::hash<int>()(static_cast<int>(Arg));
}
};
}
#endif