#include "llvm/DebugInfo/PDB/Native/PDBFile.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/DebugInfo/MSF/MSFCommon.h"
#include "llvm/DebugInfo/MSF/MappedBlockStream.h"
#include "llvm/DebugInfo/PDB/Native/DbiStream.h"
#include "llvm/DebugInfo/PDB/Native/GlobalsStream.h"
#include "llvm/DebugInfo/PDB/Native/InfoStream.h"
#include "llvm/DebugInfo/PDB/Native/InjectedSourceStream.h"
#include "llvm/DebugInfo/PDB/Native/PDBStringTable.h"
#include "llvm/DebugInfo/PDB/Native/PublicsStream.h"
#include "llvm/DebugInfo/PDB/Native/RawError.h"
#include "llvm/DebugInfo/PDB/Native/SymbolStream.h"
#include "llvm/DebugInfo/PDB/Native/TpiStream.h"
#include "llvm/Support/BinaryStream.h"
#include "llvm/Support/BinaryStreamArray.h"
#include "llvm/Support/BinaryStreamReader.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/Path.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
usingnamespacellvm;
usingnamespacellvm::codeview;
usingnamespacellvm::msf;
usingnamespacellvm::pdb;
namespace {
ulittle_array;
}
PDBFile::PDBFile(StringRef Path, std::unique_ptr<BinaryStream> PdbFileBuffer,
BumpPtrAllocator &Allocator)
: … { … }
PDBFile::~PDBFile() = default;
StringRef PDBFile::getFilePath() const { … }
StringRef PDBFile::getFileDirectory() const { … }
uint32_t PDBFile::getBlockSize() const { … }
uint32_t PDBFile::getFreeBlockMapBlock() const { … }
uint32_t PDBFile::getBlockCount() const { … }
uint32_t PDBFile::getNumDirectoryBytes() const { … }
uint32_t PDBFile::getBlockMapIndex() const { … }
uint32_t PDBFile::getUnknown1() const { … }
uint32_t PDBFile::getNumDirectoryBlocks() const { … }
uint64_t PDBFile::getBlockMapOffset() const { … }
uint32_t PDBFile::getNumStreams() const { … }
uint32_t PDBFile::getMaxStreamSize() const { … }
uint32_t PDBFile::getStreamByteSize(uint32_t StreamIndex) const { … }
ArrayRef<support::ulittle32_t>
PDBFile::getStreamBlockList(uint32_t StreamIndex) const { … }
uint64_t PDBFile::getFileSize() const { … }
Expected<ArrayRef<uint8_t>> PDBFile::getBlockData(uint32_t BlockIndex,
uint32_t NumBytes) const { … }
Error PDBFile::setBlockData(uint32_t BlockIndex, uint32_t Offset,
ArrayRef<uint8_t> Data) const { … }
Error PDBFile::parseFileHeaders() { … }
Error PDBFile::parseStreamData() { … }
ArrayRef<support::ulittle32_t> PDBFile::getDirectoryBlockArray() const { … }
std::unique_ptr<MappedBlockStream>
PDBFile::createIndexedStream(uint16_t SN) const { … }
MSFStreamLayout PDBFile::getStreamLayout(uint32_t StreamIdx) const { … }
msf::MSFStreamLayout PDBFile::getFpmStreamLayout() const { … }
Expected<GlobalsStream &> PDBFile::getPDBGlobalsStream() { … }
Expected<InfoStream &> PDBFile::getPDBInfoStream() { … }
Expected<DbiStream &> PDBFile::getPDBDbiStream() { … }
Expected<TpiStream &> PDBFile::getPDBTpiStream() { … }
Expected<TpiStream &> PDBFile::getPDBIpiStream() { … }
Expected<PublicsStream &> PDBFile::getPDBPublicsStream() { … }
Expected<SymbolStream &> PDBFile::getPDBSymbolStream() { … }
Expected<PDBStringTable &> PDBFile::getStringTable() { … }
Expected<InjectedSourceStream &> PDBFile::getInjectedSourceStream() { … }
uint32_t PDBFile::getPointerSize() { … }
bool PDBFile::hasPDBDbiStream() const { … }
bool PDBFile::hasPDBGlobalsStream() { … }
bool PDBFile::hasPDBInfoStream() const { … }
bool PDBFile::hasPDBIpiStream() const { … }
bool PDBFile::hasPDBPublicsStream() { … }
bool PDBFile::hasPDBSymbolStream() { … }
bool PDBFile::hasPDBTpiStream() const { … }
bool PDBFile::hasPDBStringTable() { … }
bool PDBFile::hasPDBInjectedSourceStream() { … }
Expected<std::unique_ptr<MappedBlockStream>>
PDBFile::safelyCreateIndexedStream(uint32_t StreamIndex) const { … }
Expected<std::unique_ptr<MappedBlockStream>>
PDBFile::safelyCreateNamedStream(StringRef Name) { … }