class MappedBlockStream

Declaration

class MappedBlockStream : public BinaryStream { /* full declaration omitted */ };

Description

MappedBlockStream represents data stored in an MSF file into chunks of a particular size (called the Block Size), and whose chunks may not be necessarily contiguous. The arrangement of these chunks MSF the file is described by some other metadata contained within the MSF file. In the case of a standard MSF Stream, the layout of the stream's blocks is described by the MSF "directory", but in the case of the directory itself, the layout is described by an array at a fixed location within the MSF. MappedBlockStream provides methods for reading from and writing to one of these streams transparently, as if it were a contiguous sequence of bytes.

Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:39

Inherits from: BinaryStream

Method Overview

  • protected MappedBlockStream(uint32_t BlockSize, const llvm::msf::MSFStreamLayout & StreamLayout, llvm::BinaryStreamRef MsfData, llvm::BumpPtrAllocator & Allocator)
  • public static std::unique_ptr<MappedBlockStream> createDirectoryStream(const llvm::msf::MSFLayout & Layout, llvm::BinaryStreamRef MsfData, llvm::BumpPtrAllocator & Allocator)
  • public static std::unique_ptr<MappedBlockStream> createFpmStream(const llvm::msf::MSFLayout & Layout, llvm::BinaryStreamRef MsfData, llvm::BumpPtrAllocator & Allocator)
  • public static std::unique_ptr<MappedBlockStream> createIndexedStream(const llvm::msf::MSFLayout & Layout, llvm::BinaryStreamRef MsfData, uint32_t StreamIndex, llvm::BumpPtrAllocator & Allocator)
  • public static std::unique_ptr<MappedBlockStream> createStream(uint32_t BlockSize, const llvm::msf::MSFStreamLayout & Layout, llvm::BinaryStreamRef MsfData, llvm::BumpPtrAllocator & Allocator)
  • public llvm::BumpPtrAllocator & getAllocator()
  • public uint32_t getBlockSize() const
  • public support::endianness getEndian() const
  • public uint32_t getLength()
  • public uint32_t getNumBlocks() const
  • public uint32_t getStreamLength() const
  • public void invalidateCache()
  • public llvm::Error readBytes(uint32_t Offset, uint32_t Size, ArrayRef<uint8_t> & Buffer)
  • public llvm::Error readLongestContiguousChunk(uint32_t Offset, ArrayRef<uint8_t> & Buffer)

Inherited from BinaryStream:

Methods

MappedBlockStream(
    uint32_t BlockSize,
    const llvm::msf::MSFStreamLayout&
        StreamLayout,
    llvm::BinaryStreamRef MsfData,
    llvm::BumpPtrAllocator& Allocator)

Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:79

Parameters

uint32_t BlockSize
const llvm::msf::MSFStreamLayout& StreamLayout
llvm::BinaryStreamRef MsfData
llvm::BumpPtrAllocator& Allocator

static std::unique_ptr<MappedBlockStream>
createDirectoryStream(
    const llvm::msf::MSFLayout& Layout,
    llvm::BinaryStreamRef MsfData,
    llvm::BumpPtrAllocator& Allocator)

Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:56

Parameters

const llvm::msf::MSFLayout& Layout
llvm::BinaryStreamRef MsfData
llvm::BumpPtrAllocator& Allocator

static std::unique_ptr<MappedBlockStream>
createFpmStream(
    const llvm::msf::MSFLayout& Layout,
    llvm::BinaryStreamRef MsfData,
    llvm::BumpPtrAllocator& Allocator)

Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:52

Parameters

const llvm::msf::MSFLayout& Layout
llvm::BinaryStreamRef MsfData
llvm::BumpPtrAllocator& Allocator

static std::unique_ptr<MappedBlockStream>
createIndexedStream(
    const llvm::msf::MSFLayout& Layout,
    llvm::BinaryStreamRef MsfData,
    uint32_t StreamIndex,
    llvm::BumpPtrAllocator& Allocator)

Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:48

Parameters

const llvm::msf::MSFLayout& Layout
llvm::BinaryStreamRef MsfData
uint32_t StreamIndex
llvm::BumpPtrAllocator& Allocator

static std::unique_ptr<MappedBlockStream>
createStream(
    uint32_t BlockSize,
    const llvm::msf::MSFStreamLayout& Layout,
    llvm::BinaryStreamRef MsfData,
    llvm::BumpPtrAllocator& Allocator)

Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:44

Parameters

uint32_t BlockSize
const llvm::msf::MSFStreamLayout& Layout
llvm::BinaryStreamRef MsfData
llvm::BumpPtrAllocator& Allocator

llvm::BumpPtrAllocator& getAllocator()

Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:70

uint32_t getBlockSize() const

Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:74

support::endianness getEndian() const

Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:59

uint32_t getLength()

Description

Return the number of bytes of data in this stream.

Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:68

uint32_t getNumBlocks() const

Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:75

uint32_t getStreamLength() const

Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:76

void invalidateCache()

Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:72

llvm::Error readBytes(uint32_t Offset,
                      uint32_t Size,
                      ArrayRef<uint8_t>& Buffer)

Description

Given an offset into the stream and a number of bytes, attempt to read the bytes and set the output ArrayRef to point to data owned by the stream.

Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:63

Parameters

uint32_t Offset
uint32_t Size
ArrayRef<uint8_t>& Buffer

llvm::Error readLongestContiguousChunk(
    uint32_t Offset,
    ArrayRef<uint8_t>& Buffer)

Description

Given an offset into the stream, read as much as possible without copying any data.

Declared at: llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h:65

Parameters

uint32_t Offset
ArrayRef<uint8_t>& Buffer