LLVM 20.0.0git
|
A class providing access to the contents of a minidump file. More...
#include "llvm/Object/Minidump.h"
Classes | |
class | MemoryInfoIterator |
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 () const |
Returns the contents of the Exception stream. | |
Expected< ArrayRef< minidump::MemoryDescriptor > > | getMemoryList () const |
Returns the list of descriptors embedded in the MemoryList 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 23 of file Minidump.h.
Definition at line 30 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 112 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 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.
Definition at line 89 of file Minidump.h.
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 57 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 101 of file Minidump.h.
|
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 72 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 51 of file Minidump.h.
|
inline |
Returns the raw contents of the stream given by the directory entry.
Definition at line 39 of file Minidump.h.
References llvm::minidump::LocationDescriptor::DataSize, llvm::minidump::Directory::Location, llvm::minidump::LocationDescriptor::RVA, and llvm::ArrayRef< T >::slice().
Referenced by 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 18 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 25 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 63 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 81 of file Minidump.h.
|
inline |
Returns the contents of the minidump header.
Definition at line 33 of file Minidump.h.
|
inline |
Returns the list of streams (stream directory entries) in this file.
Definition at line 36 of file Minidump.h.