llvm/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp

//===- PDBFile.cpp - Low level interface to a PDB file ----------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#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;
} // end anonymous namespace

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() {}

/// Wrapper around MappedBlockStream::createIndexedStream() that checks if a
/// stream with that index actually exists.  If it does not, the return value
/// will have an MSFError with code msf_error_code::no_stream.  Else, the return
/// value will contain the stream returned by createIndexedStream().
Expected<std::unique_ptr<MappedBlockStream>>
PDBFile::safelyCreateIndexedStream(uint32_t StreamIndex) const {}

Expected<std::unique_ptr<MappedBlockStream>>
PDBFile::safelyCreateNamedStream(StringRef Name) {}