LLVM: llvm::object::MinidumpFile Class Reference (original) (raw)

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

#include "[llvm/Object/Minidump.h](Object%5F2Minidump%5F8h%5Fsource.html)"

Public Member Functions
const minidump::Header & header () const
Returns the contents of the minidump header.
ArrayRef< minidump::Directory > streams () const
Returns the list of streams (stream directory entries) in this file.
ArrayRef< uint8_t > getRawStream (const minidump::Directory &Stream) const
Returns the raw contents of the stream given by the directory entry.
LLVM_ABI std::optional< ArrayRef< uint8_t > > getRawStream (minidump::StreamType Type) const
Returns the raw contents of the stream of the given type, or std::nullopt if the file does not contain a stream of this type.
Expected< ArrayRef< uint8_t > > getRawData (minidump::LocationDescriptor Desc) const
Returns the raw contents of an object given by the LocationDescriptor.
LLVM_ABI Expected< std::string > getString (size_t Offset) const
Returns the minidump string at the given offset.
Expected< const minidump::SystemInfo & > getSystemInfo () const
Returns the contents of the SystemInfo stream, cast to the appropriate type.
Expected< ArrayRef< minidump::Module > > getModuleList () const
Returns the module list embedded in the ModuleList stream.
Expected< ArrayRef< minidump::Thread > > getThreadList () const
Returns the thread list embedded in the ThreadList stream.
Expected< const minidump::ExceptionStream & > getExceptionStream (minidump::Directory Directory) const
Returns the contents of the Exception stream.
Expected< const minidump::ExceptionStream & > getExceptionStream () const
Returns the first exception stream in the file.
Expected< ArrayRef< minidump::MemoryDescriptor > > getMemoryList () const
Returns the list of descriptors embedded in the MemoryList stream.
Expected< minidump::Memory64ListHeader > getMemoryList64Header () const
Returns the header to the memory 64 list stream.
LLVM_ABI iterator_range< ExceptionStreamsIterator > getExceptionStreams () const
Returns an iterator that reads each exception stream independently.
LLVM_ABI iterator_range< FallibleMemory64Iterator > getMemory64List (Error &Err) const
Returns an iterator that pairs each descriptor with it's respective content from the Memory64List stream.
LLVM_ABI Expected< iterator_range< MemoryInfoIterator > > getMemoryInfoList () const
Returns the list of descriptors embedded in the MemoryInfoList stream.
Public Member Functions inherited from llvm::object::Binary
Binary ()=delete
Binary (const Binary &other)=delete
virtual ~Binary ()
virtual Error initContent ()
StringRef getData () const
StringRef getFileName () const
MemoryBufferRef getMemoryBufferRef () const
unsigned int getType () const
bool isObject () const
bool isSymbolic () const
bool isArchive () const
bool isMachOUniversalBinary () const
bool isTapiUniversal () const
bool isELF () const
bool isMachO () const
bool isCOFF () const
bool isXCOFF () const
bool isWasm () const
bool isOffloadFile () const
bool isCOFFImportFile () const
bool isIR () const
bool isGOFF () const
bool isMinidump () const
bool isTapiFile () const
bool isLittleEndian () const
bool isWinRes () const
bool isDXContainer () const
Triple::ObjectFormatType getTripleObjectFormat () const
Static Public Member Functions
static LLVM_ABI Expected< std::unique_ptr< MinidumpFile > > create (MemoryBufferRef Source)
Construct a new MinidumpFile object from the given memory buffer.
static bool classof (const Binary *B)
Static Public Member Functions inherited from llvm::object::Binary
static Error checkOffset (MemoryBufferRef M, uintptr_t Addr, const uint64_t Size)
Additional Inherited Members
Protected Types inherited from llvm::object::Binary
enum { ID_Archive, ID_MachOUniversalBinary, ID_COFFImportFile, ID_IR, ID_TapiUniversal, ID_TapiFile, ID_Minidump, ID_WinRes, ID_Offload, ID_StartObjects, ID_COFF, ID_XCOFF32, ID_XCOFF64, ID_ELF32L, ID_ELF32B, ID_ELF64L, ID_ELF64B, ID_MachO32L, ID_MachO32B, ID_MachO64L, ID_MachO64B, ID_GOFF, ID_Wasm, ID_DXContainer, ID_EndObjects }
Protected Member Functions inherited from llvm::object::Binary
Binary (unsigned int Type, MemoryBufferRef Source)
Static Protected Member Functions inherited from llvm::object::Binary
static unsigned int getELFType (bool isLE, bool is64Bits)
static unsigned int getMachOType (bool isLE, bool is64Bits)
Protected Attributes inherited from llvm::object::Binary
MemoryBufferRef Data

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

Definition at line 25 of file Minidump.h.

FallibleMemory64Iterator

classof()

create()

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).

Definition at line 91 of file Minidump.cpp.

References llvm::arrayRefFromStringRef(), llvm::object::Binary::Data, llvm::enumerate(), llvm::minidump::Header::MagicSignature, llvm::minidump::Header::MagicVersion, llvm::minidump::Header::NumberOfStreams, llvm::minidump::Header::Signature, llvm::minidump::Header::StreamDirectoryRVA, llvm::Expected< T >::takeError(), llvm::Type::Type(), llvm::minidump::Unused, and llvm::minidump::Header::Version.

Referenced by llvm::object::createBinary().

getExceptionStream() [1/2]

Returns the first exception stream in the file.

An error is returned if the associated stream is smaller than the size of the ExceptionStream structure. Or the directory supplied is not of kind exception stream.

Definition at line 103 of file Minidump.h.

References getExceptionStreams().

getExceptionStream() [2/2]

Returns the contents of the Exception stream.

An error is returned if the associated stream is smaller than the size of the ExceptionStream structure. Or the directory supplied is not of kind exception stream.

Definition at line 92 of file Minidump.h.

References llvm::minidump::Directory::Type.

getExceptionStreams()

Returns an iterator that reads each exception stream independently.

The contents of the exception strema are not validated before being read, an error will be returned if the stream is not large enough to contain an exception stream, or if the stream points beyond the end of the file.

Definition at line 56 of file Minidump.cpp.

References llvm::make_range().

Referenced by getExceptionStream().

getMemory64List()

Returns an iterator that pairs each descriptor with it's respective content from the Memory64List stream.

An error is returned if the file does not contain a Memory64List stream, or if the descriptor data is unreadable.

Definition at line 147 of file Minidump.cpp.

References llvm::object::MinidumpFile::Memory64Iterator::begin(), llvm::fallible_iterator< Memory64Iterator >::end(), llvm::object::MinidumpFile::Memory64Iterator::end(), llvm::object::Binary::getData(), getMemoryList64Header(), getRawStream(), llvm::fallible_iterator< Memory64Iterator >::itr(), llvm::make_range(), llvm::size(), and llvm::Expected< T >::takeError().

getMemoryInfoList()

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.

Definition at line 62 of file Minidump.cpp.

References llvm::object::Binary::Data, getRawStream(), H, and llvm::make_range().

getMemoryList()

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.

Definition at line 117 of file Minidump.h.

getMemoryList64Header()

Returns the header to the memory 64 list stream.

An error is returned if the file does not contain this stream.

Definition at line 124 of file Minidump.h.

Referenced by getMemory64List().

getModuleList()

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.

Definition at line 75 of file Minidump.h.

getRawData()

Returns the raw contents of an object given by the LocationDescriptor.

An error is returned if the descriptor points outside of the minidump file.

Definition at line 54 of file Minidump.h.

References llvm::object::Binary::getData().

getRawStream() [1/2]

getRawStream() [2/2]

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

Definition at line 17 of file Minidump.cpp.

References getRawStream().

getString()

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

getSystemInfo()

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.

Definition at line 66 of file Minidump.h.

getThreadList()

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.

Definition at line 84 of file Minidump.h.

header()

Returns the contents of the minidump header.

Definition at line 36 of file Minidump.h.

streams()

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

Definition at line 39 of file Minidump.h.


The documentation for this class was generated from the following files: