class MinidumpFile

Declaration

class MinidumpFile : public Binary { /* full declaration omitted */ };

Description

A class providing access to the contents of a minidump file.

Declared at: llvm/include/llvm/Object/Minidump.h:23

Inherits from: Binary

Member Variables

private const minidump::Header& Header
private ArrayRef<minidump::Directory> Streams
private DenseMap<minidump::StreamType, std::size_t> StreamMap

Inherited from Binary:

protected Data

Method Overview

  • private MinidumpFile(llvm::MemoryBufferRef Source, const minidump::Header & Header, ArrayRef<minidump::Directory> Streams, DenseMap<minidump::StreamType, std::size_t> StreamMap)
  • public static bool classof(const llvm::object::Binary * B)
  • public static Expected<std::unique_ptr<MinidumpFile>> create(llvm::MemoryBufferRef Source)
  • private static llvm::Error createEOFError()
  • private static llvm::Error createError(llvm::StringRef Str)
  • private ArrayRef<uint8_t> getData() const
  • private static Expected<ArrayRef<uint8_t>> getDataSlice(ArrayRef<uint8_t> Data, size_t Offset, size_t Size)
  • private template <typename T>static Expected<ArrayRef<T>> getDataSliceAs(ArrayRef<uint8_t> Data, size_t Offset, size_t Count)
  • public Expected<const minidump::ExceptionStream &> getExceptionStream() const
  • private template <typename T>Expected<ArrayRef<T>> getListStream(minidump::StreamType Stream) const
  • public Expected<iterator_range<llvm::object::MinidumpFile::MemoryInfoIterator>> getMemoryInfoList() const
  • public Expected<ArrayRef<minidump::MemoryDescriptor>> getMemoryList() const
  • public Expected<ArrayRef<minidump::Module>> getModuleList() const
  • public Expected<ArrayRef<uint8_t>> getRawData(minidump::LocationDescriptor Desc) const
  • public Optional<ArrayRef<uint8_t>> getRawStream(minidump::StreamType Type) const
  • public ArrayRef<uint8_t> getRawStream(const minidump::Directory & Stream) const
  • private template <typename T>Expected<const T &> getStream(minidump::StreamType Stream) const
  • public Expected<std::string> getString(size_t Offset) const
  • public Expected<const minidump::SystemInfo &> getSystemInfo() const
  • public Expected<ArrayRef<minidump::Thread>> getThreadList() const
  • public const minidump::Header & header() const
  • public ArrayRef<minidump::Directory> streams() const

Inherited from Binary:

Methods

MinidumpFile(
    llvm::MemoryBufferRef Source,
    const minidump::Header& Header,
    ArrayRef<minidump::Directory> Streams,
    DenseMap<minidump::StreamType, std::size_t>
        StreamMap)

Declared at: llvm/include/llvm/Object/Minidump.h:164

Parameters

llvm::MemoryBufferRef Source
const minidump::Header& Header
ArrayRef<minidump::Directory> Streams
DenseMap<minidump::StreamType, std::size_t> StreamMap

static bool classof(const llvm::object::Binary* B)

Declared at: llvm/include/llvm/Object/Minidump.h:30

Parameters

const llvm::object::Binary* B

static Expected<std::unique_ptr<MinidumpFile>>
create(llvm::MemoryBufferRef Source)

Description

Construct a new MinidumpFile object from the given memory buffer. Returns an error if this file cannot be identified as a minidump file, or if its contents are badly corrupted (i.e. we cannot read the stream directory).

Declared at: llvm/include/llvm/Object/Minidump.h:28

Parameters

llvm::MemoryBufferRef Source

static llvm::Error createEOFError()

Declared at: llvm/include/llvm/Object/Minidump.h:148

static llvm::Error createError(
    llvm::StringRef Str)

Declared at: llvm/include/llvm/Object/Minidump.h:144

Parameters

llvm::StringRef Str

ArrayRef<uint8_t> getData() const

Declared at: llvm/include/llvm/Object/Minidump.h:170

static Expected<ArrayRef<uint8_t>> getDataSlice(
    ArrayRef<uint8_t> Data,
    size_t Offset,
    size_t Size)

Description

Return a slice of the given data array, with bounds checking.

Declared at: llvm/include/llvm/Object/Minidump.h:154

Parameters

ArrayRef<uint8_t> Data
size_t Offset
size_t Size

template <typename T>
static Expected<ArrayRef<T>> getDataSliceAs(
    ArrayRef<uint8_t> Data,
    size_t Offset,
    size_t Count)

Description

Return the slice of the given data array as an array of objects of the given type. The function checks that the input array is large enough to contain the correct number of objects of the given type.

Declared at: llvm/include/llvm/Object/Minidump.h:161

Templates

T

Parameters

ArrayRef<uint8_t> Data
size_t Offset
size_t Count

Expected<const minidump::ExceptionStream&>
getExceptionStream() const

Description

Returns the contents of the Exception stream. An error is returned if the file does not contain this stream, or the stream is smaller than the size of the ExceptionStream structure. The internal consistency of the stream is not checked in any way.

Declared at: llvm/include/llvm/Object/Minidump.h:88

template <typename T>
Expected<ArrayRef<T>> getListStream(
    minidump::StreamType Stream) const

Description

Return the contents of a stream which contains a list of fixed-size items, prefixed by the list size.

Declared at: llvm/include/llvm/Object/Minidump.h:182

Templates

T

Parameters

minidump::StreamType Stream

Expected<
    iterator_range<llvm::object::MinidumpFile::
                       MemoryInfoIterator>>
getMemoryInfoList() const

Description

Returns the list of descriptors embedded in the MemoryInfoList stream. The descriptors provide properties (e.g. permissions) of interesting regions of memory at the time the minidump was taken. An error is returned if the file does not contain this stream, or if the stream is not large enough to contain the number of memory descriptors declared in the stream header. The consistency of the MemoryInfoList entries themselves is not checked in any way.

Declared at: llvm/include/llvm/Object/Minidump.h:141

Expected<ArrayRef<minidump::MemoryDescriptor>>
getMemoryList() const

Description

Returns the list of descriptors embedded in the MemoryList stream. The descriptors provide the content of interesting regions of memory at the time the minidump was taken. An error is returned if the file does not contain this stream, or if the stream is not large enough to contain the number of memory descriptors declared in the stream header. The consistency of the MemoryDescriptor entries themselves is not checked in any way.

Declared at: llvm/include/llvm/Object/Minidump.h:100

Expected<ArrayRef<minidump::Module>>
getModuleList() const

Description

Returns the module list embedded in the ModuleList stream. An error is returned if the file does not contain this stream, or if the stream is not large enough to contain the number of modules declared in the stream header. The consistency of the Module entries themselves is not checked in any way.

Declared at: llvm/include/llvm/Object/Minidump.h:71

Expected<ArrayRef<uint8_t>> getRawData(
    minidump::LocationDescriptor Desc) const

Description

Returns the raw contents of an object given by the LocationDescriptor. An error is returned if the descriptor points outside of the minidump file.

Declared at: llvm/include/llvm/Object/Minidump.h:50

Parameters

minidump::LocationDescriptor Desc

Optional<ArrayRef<uint8_t>> getRawStream(
    minidump::StreamType Type) const

Description

Returns the raw contents of the stream of the given type, or None if the file does not contain a stream of this type.

Declared at: llvm/include/llvm/Object/Minidump.h:45

Parameters

minidump::StreamType Type

ArrayRef<uint8_t> getRawStream(
    const minidump::Directory& Stream) const

Description

Returns the raw contents of the stream given by the directory entry.

Declared at: llvm/include/llvm/Object/Minidump.h:39

Parameters

const minidump::Directory& Stream

template <typename T>
Expected<const T&> getStream(
    minidump::StreamType Stream) const

Description

Return the stream of the given type, cast to the appropriate type. Checks that the stream is large enough to hold an object of this type.

Declared at: llvm/include/llvm/Object/Minidump.h:177

Templates

T

Parameters

minidump::StreamType Stream

Expected<std::string> getString(
    size_t Offset) const

Description

Returns the minidump string at the given offset. An error is returned if we fail to parse the string, or the string is invalid UTF16.

Declared at: llvm/include/llvm/Object/Minidump.h:56

Parameters

size_t Offset

Expected<const minidump::SystemInfo&>
getSystemInfo() const

Description

Returns the contents of the SystemInfo stream, cast to the appropriate type. An error is returned if the file does not contain this stream, or the stream is smaller than the size of the SystemInfo structure. The internal consistency of the stream is not checked in any way.

Declared at: llvm/include/llvm/Object/Minidump.h:62

Expected<ArrayRef<minidump::Thread>>
getThreadList() const

Description

Returns the thread list embedded in the ThreadList stream. An error is returned if the file does not contain this stream, or if the stream is not large enough to contain the number of threads declared in the stream header. The consistency of the Thread entries themselves is not checked in any way.

Declared at: llvm/include/llvm/Object/Minidump.h:80

const minidump::Header& header() const

Description

Returns the contents of the minidump header.

Declared at: llvm/include/llvm/Object/Minidump.h:33

ArrayRef<minidump::Directory> streams() const

Description

Returns the list of streams (stream directory entries) in this file.

Declared at: llvm/include/llvm/Object/Minidump.h:36