Introduce NativeRawSymbol for PDB reading.

This is a stub for a new concrete implementation of IPDBRawSymbol.
Nothing uses this uses this implementation yet.  My plan is to
locally switch lldb-pdbdump from the DIA reader to the Native one
and flesh out the implementations of these method stubs in the order
they're needed.

llvm-svn: 294633
This commit is contained in:
Adrian McCarthy 2017-02-09 21:51:19 +00:00
parent 714d9d22ad
commit 0beb3323c5
3 changed files with 908 additions and 0 deletions

View File

@ -0,0 +1,207 @@
//===- NativeRawSymbol.h - Native implementation of IPDBRawSymbol - 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_NATIVE_NATIVERAWSYMBOL_H
#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVERAWSYMBOL_H
#include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
namespace llvm {
namespace pdb {
class NativeSession;
class NativeRawSymbol : public IPDBRawSymbol {
public:
explicit NativeRawSymbol(const NativeSession &PDBSession);
void dump(raw_ostream &OS, int Indent) const override;
std::unique_ptr<IPDBEnumSymbols>
findChildren(PDB_SymType Type) const override;
std::unique_ptr<IPDBEnumSymbols>
findChildren(PDB_SymType Type, StringRef Name,
PDB_NameSearchFlags Flags) const override;
std::unique_ptr<IPDBEnumSymbols>
findChildrenByRVA(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags,
uint32_t RVA) const override;
std::unique_ptr<IPDBEnumSymbols>
findInlineFramesByRVA(uint32_t RVA) const override;
void getDataBytes(llvm::SmallVector<uint8_t, 32> &Bytes) const override;
void getFrontEndVersion(VersionInfo &Version) const override;
void getBackEndVersion(VersionInfo &Version) const override;
PDB_MemberAccess getAccess() const override;
uint32_t getAddressOffset() const override;
uint32_t getAddressSection() const override;
uint32_t getAge() const override;
uint32_t getArrayIndexTypeId() const override;
uint32_t getBaseDataOffset() const override;
uint32_t getBaseDataSlot() const override;
uint32_t getBaseSymbolId() const override;
PDB_BuiltinType getBuiltinType() const override;
uint32_t getBitPosition() const override;
PDB_CallingConv getCallingConvention() const override;
uint32_t getClassParentId() const override;
std::string getCompilerName() const override;
uint32_t getCount() const override;
uint32_t getCountLiveRanges() const override;
PDB_Lang getLanguage() const override;
uint32_t getLexicalParentId() const override;
std::string getLibraryName() const override;
uint32_t getLiveRangeStartAddressOffset() const override;
uint32_t getLiveRangeStartAddressSection() const override;
uint32_t getLiveRangeStartRelativeVirtualAddress() const override;
codeview::RegisterId getLocalBasePointerRegisterId() const override;
uint32_t getLowerBoundId() const override;
uint32_t getMemorySpaceKind() const override;
std::string getName() const override;
uint32_t getNumberOfAcceleratorPointerTags() const override;
uint32_t getNumberOfColumns() const override;
uint32_t getNumberOfModifiers() const override;
uint32_t getNumberOfRegisterIndices() const override;
uint32_t getNumberOfRows() const override;
std::string getObjectFileName() const override;
uint32_t getOemId() const override;
uint32_t getOemSymbolId() const override;
uint32_t getOffsetInUdt() const override;
PDB_Cpu getPlatform() const override;
uint32_t getRank() const override;
codeview::RegisterId getRegisterId() const override;
uint32_t getRegisterType() const override;
uint32_t getRelativeVirtualAddress() const override;
uint32_t getSamplerSlot() const override;
uint32_t getSignature() const override;
uint32_t getSizeInUdt() const override;
uint32_t getSlot() const override;
std::string getSourceFileName() const override;
uint32_t getStride() const override;
uint32_t getSubTypeId() const override;
std::string getSymbolsFileName() const override;
uint32_t getSymIndexId() const override;
uint32_t getTargetOffset() const override;
uint32_t getTargetRelativeVirtualAddress() const override;
uint64_t getTargetVirtualAddress() const override;
uint32_t getTargetSection() const override;
uint32_t getTextureSlot() const override;
uint32_t getTimeStamp() const override;
uint32_t getToken() const override;
uint32_t getTypeId() const override;
uint32_t getUavSlot() const override;
std::string getUndecoratedName() const override;
uint32_t getUnmodifiedTypeId() const override;
uint32_t getUpperBoundId() const override;
Variant getValue() const override;
uint32_t getVirtualBaseDispIndex() const override;
uint32_t getVirtualBaseOffset() const override;
uint32_t getVirtualTableShapeId() const override;
PDB_DataKind getDataKind() const override;
PDB_SymType getSymTag() const override;
PDB_UniqueId getGuid() const override;
int32_t getOffset() const override;
int32_t getThisAdjust() const override;
int32_t getVirtualBasePointerOffset() const override;
PDB_LocType getLocationType() const override;
PDB_Machine getMachineType() const override;
codeview::ThunkOrdinal getThunkOrdinal() const override;
uint64_t getLength() const override;
uint64_t getLiveRangeLength() const override;
uint64_t getVirtualAddress() const override;
PDB_UdtType getUdtKind() const override;
bool hasConstructor() const override;
bool hasCustomCallingConvention() const override;
bool hasFarReturn() const override;
bool isCode() const override;
bool isCompilerGenerated() const override;
bool isConstType() const override;
bool isEditAndContinueEnabled() const override;
bool isFunction() const override;
bool getAddressTaken() const override;
bool getNoStackOrdering() const override;
bool hasAlloca() const override;
bool hasAssignmentOperator() const override;
bool hasCTypes() const override;
bool hasCastOperator() const override;
bool hasDebugInfo() const override;
bool hasEH() const override;
bool hasEHa() const override;
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;
bool hasNoInlineAttribute() const override;
bool hasNoReturnAttribute() const override;
bool hasOptimizedCodeDebugInfo() const override;
bool hasOverloadedOperator() const override;
bool hasSEH() const override;
bool hasSecurityChecks() const override;
bool hasSetJump() const override;
bool hasStrictGSCheck() const override;
bool isAcceleratorGroupSharedLocal() const override;
bool isAcceleratorPointerTagLiveRange() const override;
bool isAcceleratorStubFunction() const override;
bool isAggregated() const override;
bool isIntroVirtualFunction() const override;
bool isCVTCIL() const override;
bool isConstructorVirtualBase() const override;
bool isCxxReturnUdt() const override;
bool isDataAligned() const override;
bool isHLSLData() const override;
bool isHotpatchable() const override;
bool isIndirectVirtualBaseClass() const override;
bool isInterfaceUdt() const override;
bool isIntrinsic() const override;
bool isLTCG() const override;
bool isLocationControlFlowDependent() const override;
bool isMSILNetmodule() const override;
bool isMatrixRowMajor() const override;
bool isManagedCode() const override;
bool isMSILCode() const override;
bool isMultipleInheritance() const override;
bool isNaked() const override;
bool isNested() const override;
bool isOptimizedAway() const override;
bool isPacked() const override;
bool isPointerBasedOnSymbolValue() const override;
bool isPointerToDataMember() const override;
bool isPointerToMemberFunction() const override;
bool isPureVirtual() const override;
bool isRValueReference() const override;
bool isRefUdt() const override;
bool isReference() const override;
bool isRestrictedType() const override;
bool isReturnValue() const override;
bool isSafeBuffers() const override;
bool isScoped() const override;
bool isSdl() const override;
bool isSingleInheritance() const override;
bool isSplitted() const override;
bool isStatic() const override;
bool hasPrivateSymbols() const override;
bool isUnalignedType() const override;
bool isUnreached() const override;
bool isValueUdt() const override;
bool isVirtual() const override;
bool isVirtualBaseClass() const override;
bool isVirtualInheritance() const override;
bool isVolatileType() const override;
bool wasInlined() const override;
std::string getUnused() const override;
private:
const NativeSession &Session;
};
}
}
#endif

View File

@ -39,6 +39,7 @@ add_pdb_impl_folder(Native
Native/InfoStreamBuilder.cpp
Native/ModInfo.cpp
Native/ModStream.cpp
Native/NativeRawSymbol.cpp
Native/NamedStreamMap.cpp
Native/NativeSession.cpp
Native/PDBFile.cpp

View File

@ -0,0 +1,700 @@
//===- NativeRawSymbol.cpp - Native implementation of IPDBRawSymbol -*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
#include "llvm/DebugInfo/PDB/PDBExtras.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
using namespace llvm::pdb;
NativeRawSymbol::NativeRawSymbol(const NativeSession &PDBSession)
: Session(PDBSession) {}
void NativeRawSymbol::dump(raw_ostream &OS, int Indent) const {}
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findChildren(PDB_SymType Type) const {
return nullptr;
}
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findChildren(PDB_SymType Type, StringRef Name,
PDB_NameSearchFlags Flags) const {
return nullptr;
}
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findChildrenByRVA(PDB_SymType Type, StringRef Name,
PDB_NameSearchFlags Flags, uint32_t RVA) const {
return nullptr;
}
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findInlineFramesByRVA(uint32_t RVA) const {
return nullptr;
}
void NativeRawSymbol::getDataBytes(llvm::SmallVector<uint8_t, 32> &bytes) const {
bytes.clear();
}
PDB_MemberAccess NativeRawSymbol::getAccess() const {
return PDB_MemberAccess::Private;
}
uint32_t NativeRawSymbol::getAddressOffset() const {
return 0;
}
uint32_t NativeRawSymbol::getAddressSection() const {
return 0;
}
uint32_t NativeRawSymbol::getAge() const {
return 0;
}
uint32_t NativeRawSymbol::getArrayIndexTypeId() const {
return 0;
}
void NativeRawSymbol::getBackEndVersion(VersionInfo &Version) const {
Version.Major = 0;
Version.Minor = 0;
Version.Build = 0;
Version.QFE = 0;
}
uint32_t NativeRawSymbol::getBaseDataOffset() const {
return 0;
}
uint32_t NativeRawSymbol::getBaseDataSlot() const {
return 0;
}
uint32_t NativeRawSymbol::getBaseSymbolId() const {
return 0;
}
PDB_BuiltinType NativeRawSymbol::getBuiltinType() const {
return PDB_BuiltinType::None;
}
uint32_t NativeRawSymbol::getBitPosition() const {
return 0;
}
PDB_CallingConv NativeRawSymbol::getCallingConvention() const {
return PDB_CallingConv::FarStdCall;
}
uint32_t NativeRawSymbol::getClassParentId() const {
return 0;
}
std::string NativeRawSymbol::getCompilerName() const {
return 0;
}
uint32_t NativeRawSymbol::getCount() const {
return 0;
}
uint32_t NativeRawSymbol::getCountLiveRanges() const {
return 0;
}
void NativeRawSymbol::getFrontEndVersion(VersionInfo &Version) const {
Version.Major = 0;
Version.Minor = 0;
Version.Build = 0;
Version.QFE = 0;
}
PDB_Lang NativeRawSymbol::getLanguage() const {
return PDB_Lang::Cobol;
}
uint32_t NativeRawSymbol::getLexicalParentId() const {
return 0;
}
std::string NativeRawSymbol::getLibraryName() const {
return "";
}
uint32_t NativeRawSymbol::getLiveRangeStartAddressOffset() const {
return 0;
}
uint32_t NativeRawSymbol::getLiveRangeStartAddressSection() const {
return 0;
}
uint32_t NativeRawSymbol::getLiveRangeStartRelativeVirtualAddress() const {
return 0;
}
codeview::RegisterId NativeRawSymbol::getLocalBasePointerRegisterId() const {
return codeview::RegisterId::EAX;
}
uint32_t NativeRawSymbol::getLowerBoundId() const {
return 0;
}
uint32_t NativeRawSymbol::getMemorySpaceKind() const {
return 0;
}
std::string NativeRawSymbol::getName() const {
return 0;
}
uint32_t NativeRawSymbol::getNumberOfAcceleratorPointerTags() const {
return 0;
}
uint32_t NativeRawSymbol::getNumberOfColumns() const {
return 0;
}
uint32_t NativeRawSymbol::getNumberOfModifiers() const {
return 0;
}
uint32_t NativeRawSymbol::getNumberOfRegisterIndices() const {
return 0;
}
uint32_t NativeRawSymbol::getNumberOfRows() const {
return 0;
}
std::string NativeRawSymbol::getObjectFileName() const {
return "";
}
uint32_t NativeRawSymbol::getOemId() const {
return 0;
}
uint32_t NativeRawSymbol::getOemSymbolId() const {
return 0;
}
uint32_t NativeRawSymbol::getOffsetInUdt() const {
return 0;
}
PDB_Cpu NativeRawSymbol::getPlatform() const {
return PDB_Cpu::Intel8080;
}
uint32_t NativeRawSymbol::getRank() const {
return 0;
}
codeview::RegisterId NativeRawSymbol::getRegisterId() const {
return codeview::RegisterId::EAX;
}
uint32_t NativeRawSymbol::getRegisterType() const {
return 0;
}
uint32_t NativeRawSymbol::getRelativeVirtualAddress() const {
return 0;
}
uint32_t NativeRawSymbol::getSamplerSlot() const {
return 0;
}
uint32_t NativeRawSymbol::getSignature() const {
return 0;
}
uint32_t NativeRawSymbol::getSizeInUdt() const {
return 0;
}
uint32_t NativeRawSymbol::getSlot() const {
return 0;
}
std::string NativeRawSymbol::getSourceFileName() const {
return 0;
}
uint32_t NativeRawSymbol::getStride() const {
return 0;
}
uint32_t NativeRawSymbol::getSubTypeId() const {
return 0;
}
std::string NativeRawSymbol::getSymbolsFileName() const {
return 0;
}
uint32_t NativeRawSymbol::getSymIndexId() const {
return 0;
}
uint32_t NativeRawSymbol::getTargetOffset() const {
return 0;
}
uint32_t NativeRawSymbol::getTargetRelativeVirtualAddress() const {
return 0;
}
uint64_t NativeRawSymbol::getTargetVirtualAddress() const {
return 0;
}
uint32_t NativeRawSymbol::getTargetSection() const {
return 0;
}
uint32_t NativeRawSymbol::getTextureSlot() const {
return 0;
}
uint32_t NativeRawSymbol::getTimeStamp() const {
return 0;
}
uint32_t NativeRawSymbol::getToken() const {
return 0;
}
uint32_t NativeRawSymbol::getTypeId() const {
return 0;
}
uint32_t NativeRawSymbol::getUavSlot() const {
return 0;
}
std::string NativeRawSymbol::getUndecoratedName() const {
return 0;
}
uint32_t NativeRawSymbol::getUnmodifiedTypeId() const {
return 0;
}
uint32_t NativeRawSymbol::getUpperBoundId() const {
return 0;
}
Variant NativeRawSymbol::getValue() const {
return Variant();
}
uint32_t NativeRawSymbol::getVirtualBaseDispIndex() const {
return 0;
}
uint32_t NativeRawSymbol::getVirtualBaseOffset() const {
return 0;
}
uint32_t NativeRawSymbol::getVirtualTableShapeId() const {
return 0;
}
PDB_DataKind NativeRawSymbol::getDataKind() const {
return PDB_DataKind::Unknown;
}
PDB_SymType NativeRawSymbol::getSymTag() const {
return PDB_SymType::None;
}
PDB_UniqueId NativeRawSymbol::getGuid() const {
return {0, 0, 0, 0};
}
int32_t NativeRawSymbol::getOffset() const {
return 0;
}
int32_t NativeRawSymbol::getThisAdjust() const {
return 0;
}
int32_t NativeRawSymbol::getVirtualBasePointerOffset() const {
return 0;
}
PDB_LocType NativeRawSymbol::getLocationType() const {
return PDB_LocType::Null;
}
PDB_Machine NativeRawSymbol::getMachineType() const {
return PDB_Machine::Invalid;
}
codeview::ThunkOrdinal NativeRawSymbol::getThunkOrdinal() const {
return codeview::ThunkOrdinal::Standard;
}
uint64_t NativeRawSymbol::getLength() const {
return 0;
}
uint64_t NativeRawSymbol::getLiveRangeLength() const {
return 0;
}
uint64_t NativeRawSymbol::getVirtualAddress() const {
return 0;
}
PDB_UdtType NativeRawSymbol::getUdtKind() const {
return PDB_UdtType::Struct;
}
bool NativeRawSymbol::hasConstructor() const {
return false;
}
bool NativeRawSymbol::hasCustomCallingConvention() const {
return false;
}
bool NativeRawSymbol::hasFarReturn() const {
return false;
}
bool NativeRawSymbol::isCode() const {
return false;
}
bool NativeRawSymbol::isCompilerGenerated() const {
return false;
}
bool NativeRawSymbol::isConstType() const {
return false;
}
bool NativeRawSymbol::isEditAndContinueEnabled() const {
return false;
}
bool NativeRawSymbol::isFunction() const {
return false;
}
bool NativeRawSymbol::getAddressTaken() const {
return false;
}
bool NativeRawSymbol::getNoStackOrdering() const {
return false;
}
bool NativeRawSymbol::hasAlloca() const {
return false;
}
bool NativeRawSymbol::hasAssignmentOperator() const {
return false;
}
bool NativeRawSymbol::hasCTypes() const {
return false;
}
bool NativeRawSymbol::hasCastOperator() const {
return false;
}
bool NativeRawSymbol::hasDebugInfo() const {
return false;
}
bool NativeRawSymbol::hasEH() const {
return false;
}
bool NativeRawSymbol::hasEHa() const {
return false;
}
bool NativeRawSymbol::hasInlAsm() const {
return false;
}
bool NativeRawSymbol::hasInlineAttribute() const {
return false;
}
bool NativeRawSymbol::hasInterruptReturn() const {
return false;
}
bool NativeRawSymbol::hasFramePointer() const {
return false;
}
bool NativeRawSymbol::hasLongJump() const {
return false;
}
bool NativeRawSymbol::hasManagedCode() const {
return false;
}
bool NativeRawSymbol::hasNestedTypes() const {
return false;
}
bool NativeRawSymbol::hasNoInlineAttribute() const {
return false;
}
bool NativeRawSymbol::hasNoReturnAttribute() const {
return false;
}
bool NativeRawSymbol::hasOptimizedCodeDebugInfo() const {
return false;
}
bool NativeRawSymbol::hasOverloadedOperator() const {
return false;
}
bool NativeRawSymbol::hasSEH() const {
return false;
}
bool NativeRawSymbol::hasSecurityChecks() const {
return false;
}
bool NativeRawSymbol::hasSetJump() const {
return false;
}
bool NativeRawSymbol::hasStrictGSCheck() const {
return false;
}
bool NativeRawSymbol::isAcceleratorGroupSharedLocal() const {
return false;
}
bool NativeRawSymbol::isAcceleratorPointerTagLiveRange() const {
return false;
}
bool NativeRawSymbol::isAcceleratorStubFunction() const {
return false;
}
bool NativeRawSymbol::isAggregated() const {
return false;
}
bool NativeRawSymbol::isIntroVirtualFunction() const {
return false;
}
bool NativeRawSymbol::isCVTCIL() const {
return false;
}
bool NativeRawSymbol::isConstructorVirtualBase() const {
return false;
}
bool NativeRawSymbol::isCxxReturnUdt() const {
return false;
}
bool NativeRawSymbol::isDataAligned() const {
return false;
}
bool NativeRawSymbol::isHLSLData() const {
return false;
}
bool NativeRawSymbol::isHotpatchable() const {
return false;
}
bool NativeRawSymbol::isIndirectVirtualBaseClass() const {
return false;
}
bool NativeRawSymbol::isInterfaceUdt() const {
return false;
}
bool NativeRawSymbol::isIntrinsic() const {
return false;
}
bool NativeRawSymbol::isLTCG() const {
return false;
}
bool NativeRawSymbol::isLocationControlFlowDependent() const {
return false;
}
bool NativeRawSymbol::isMSILNetmodule() const {
return false;
}
bool NativeRawSymbol::isMatrixRowMajor() const {
return false;
}
bool NativeRawSymbol::isManagedCode() const {
return false;
}
bool NativeRawSymbol::isMSILCode() const {
return false;
}
bool NativeRawSymbol::isMultipleInheritance() const {
return false;
}
bool NativeRawSymbol::isNaked() const {
return false;
}
bool NativeRawSymbol::isNested() const {
return false;
}
bool NativeRawSymbol::isOptimizedAway() const {
return false;
}
bool NativeRawSymbol::isPacked() const {
return false;
}
bool NativeRawSymbol::isPointerBasedOnSymbolValue() const {
return false;
}
bool NativeRawSymbol::isPointerToDataMember() const {
return false;
}
bool NativeRawSymbol::isPointerToMemberFunction() const {
return false;
}
bool NativeRawSymbol::isPureVirtual() const {
return false;
}
bool NativeRawSymbol::isRValueReference() const {
return false;
}
bool NativeRawSymbol::isRefUdt() const {
return false;
}
bool NativeRawSymbol::isReference() const {
return false;
}
bool NativeRawSymbol::isRestrictedType() const {
return false;
}
bool NativeRawSymbol::isReturnValue() const {
return false;
}
bool NativeRawSymbol::isSafeBuffers() const {
return false;
}
bool NativeRawSymbol::isScoped() const {
return false;
}
bool NativeRawSymbol::isSdl() const {
return false;
}
bool NativeRawSymbol::isSingleInheritance() const {
return false;
}
bool NativeRawSymbol::isSplitted() const {
return false;
}
bool NativeRawSymbol::isStatic() const {
return false;
}
bool NativeRawSymbol::hasPrivateSymbols() const {
return false;
}
bool NativeRawSymbol::isUnalignedType() const {
return false;
}
bool NativeRawSymbol::isUnreached() const {
return false;
}
bool NativeRawSymbol::isValueUdt() const {
return false;
}
bool NativeRawSymbol::isVirtual() const {
return false;
}
bool NativeRawSymbol::isVirtualBaseClass() const {
return false;
}
bool NativeRawSymbol::isVirtualInheritance() const {
return false;
}
bool NativeRawSymbol::isVolatileType() const {
return false;
}
bool NativeRawSymbol::wasInlined() const {
return false;
}
std::string NativeRawSymbol::getUnused() const {
return "";
}