LLVM 20.0.0git
|
A class providing access to the contents of a minidump file. More...
#include "llvm/Object/Minidump.h"
Classes | |
class | ExceptionStreamsIterator |
class | Memory64Iterator |
Class the provides an iterator over the memory64 memory ranges. More... | |
class | MemoryInfoIterator |
Public Types | |
using | FallibleMemory64Iterator = llvm::fallible_iterator< Memory64Iterator > |
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. | |
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. | |
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. | |
iterator_range< ExceptionStreamsIterator > | getExceptionStreams () const |
Returns an iterator that reads each exception stream independently. | |
iterator_range< FallibleMemory64Iterator > | getMemory64List (Error &Err) const |
Returns an iterator that pairs each descriptor with it's respective content from the Memory64List stream. | |
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 |
Triple::ObjectFormatType | getTripleObjectFormat () const |
Static Public Member Functions | |
static 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_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 24 of file Minidump.h.
using llvm::object::MinidumpFile::FallibleMemory64Iterator = llvm::fallible_iterator<Memory64Iterator> |
Definition at line 262 of file Minidump.h.
Definition at line 31 of file Minidump.h.
References B.
|
static |
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::object::Binary::Data, llvm::minidump::LocationDescriptor::DataSize, llvm::enumerate(), llvm::minidump::Header::MagicSignature, llvm::minidump::Header::MagicVersion, llvm::minidump::Header::NumberOfStreams, llvm::minidump::LocationDescriptor::RVA, llvm::minidump::Header::Signature, llvm::minidump::Header::StreamDirectoryRVA, llvm::Expected< T >::takeError(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::try_emplace(), llvm::Type::Type(), and llvm::minidump::Header::Version.
Referenced by llvm::object::createBinary().
|
inline |
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 101 of file Minidump.h.
References getExceptionStreams().
|
inline |
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 90 of file Minidump.h.
References llvm::minidump::Directory::Type.
Referenced by llvm::object::MinidumpFile::ExceptionStreamsIterator::operator*().
iterator_range< llvm::object::MinidumpFile::ExceptionStreamsIterator > MinidumpFile::getExceptionStreams | ( | ) | const |
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().
iterator_range< MinidumpFile::FallibleMemory64Iterator > MinidumpFile::getMemory64List | ( | Error & | Err | ) | const |
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::object::MinidumpFile::Memory64Iterator::end(), llvm::fallible_iterator< Underlying >::end(), getMemoryList64Header(), getRawStream(), llvm::fallible_iterator< Underlying >::itr(), llvm::make_range(), llvm::size(), and llvm::Expected< T >::takeError().
Expected< iterator_range< MinidumpFile::MemoryInfoIterator > > MinidumpFile::getMemoryInfoList | ( | ) | const |
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().
|
inline |
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 115 of file Minidump.h.
|
inline |
Returns the header to the memory 64 list stream.
An error is returned if the file does not contain this stream.
Definition at line 122 of file Minidump.h.
Referenced by getMemory64List().
|
inline |
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 73 of file Minidump.h.
|
inline |
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 52 of file Minidump.h.
|
inline |
Returns the raw contents of the stream given by the directory entry.
Definition at line 40 of file Minidump.h.
References llvm::minidump::LocationDescriptor::DataSize, llvm::minidump::Directory::Location, llvm::minidump::LocationDescriptor::RVA, and llvm::ArrayRef< T >::slice().
Referenced by getMemory64List(), getMemoryInfoList(), and getRawStream().
std::optional< ArrayRef< uint8_t > > MinidumpFile::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.
Definition at line 17 of file Minidump.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), and getRawStream().
Expected< std::string > MinidumpFile::getString | ( | size_t | Offset | ) | const |
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.
Definition at line 24 of file Minidump.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::convertUTF16ToUTF8String(), llvm::copy(), llvm::Offset, and Size.
|
inline |
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 64 of file Minidump.h.
|
inline |
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 82 of file Minidump.h.
|
inline |
Returns the contents of the minidump header.
Definition at line 34 of file Minidump.h.
|
inline |
Returns the list of streams (stream directory entries) in this file.
Definition at line 37 of file Minidump.h.