LLVM 20.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::object::MinidumpFile Class Reference

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

#include "llvm/Object/Minidump.h"

Inheritance diagram for llvm::object::MinidumpFile:
Inheritance graph
[legend]

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::Headerheader () const
 Returns the contents of the minidump header.
 
ArrayRef< minidump::Directorystreams () const
 Returns the list of streams (stream directory entries) in this file.
 
ArrayRef< uint8_tgetRawStream (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::Memory64ListHeadergetMemoryList64Header () const
 Returns the header to the memory 64 list stream.
 
iterator_range< ExceptionStreamsIteratorgetExceptionStreams () const
 Returns an iterator that reads each exception stream independently.
 
iterator_range< FallibleMemory64IteratorgetMemory64List (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
 

Detailed Description

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

Definition at line 24 of file Minidump.h.

Member Typedef Documentation

◆ FallibleMemory64Iterator

Definition at line 262 of file Minidump.h.

Member Function Documentation

◆ classof()

static bool llvm::object::MinidumpFile::classof ( const Binary B)
inlinestatic

Definition at line 31 of file Minidump.h.

References B.

◆ create()

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

◆ getExceptionStream() [1/2]

Expected< const minidump::ExceptionStream & > llvm::object::MinidumpFile::getExceptionStream ( ) const
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().

◆ getExceptionStream() [2/2]

Expected< const minidump::ExceptionStream & > llvm::object::MinidumpFile::getExceptionStream ( minidump::Directory  Directory) const
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*().

◆ getExceptionStreams()

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

◆ getMemory64List()

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

◆ getMemoryInfoList()

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

◆ getMemoryList()

Expected< ArrayRef< minidump::MemoryDescriptor > > llvm::object::MinidumpFile::getMemoryList ( ) const
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.

◆ getMemoryList64Header()

Expected< minidump::Memory64ListHeader > llvm::object::MinidumpFile::getMemoryList64Header ( ) const
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().

◆ getModuleList()

Expected< ArrayRef< minidump::Module > > llvm::object::MinidumpFile::getModuleList ( ) const
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.

◆ getRawData()

Expected< ArrayRef< uint8_t > > llvm::object::MinidumpFile::getRawData ( minidump::LocationDescriptor  Desc) const
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.

◆ getRawStream() [1/2]

ArrayRef< uint8_t > llvm::object::MinidumpFile::getRawStream ( const minidump::Directory Stream) const
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().

◆ getRawStream() [2/2]

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

◆ getString()

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.

◆ getSystemInfo()

Expected< const minidump::SystemInfo & > llvm::object::MinidumpFile::getSystemInfo ( ) const
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.

◆ getThreadList()

Expected< ArrayRef< minidump::Thread > > llvm::object::MinidumpFile::getThreadList ( ) const
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.

◆ header()

const minidump::Header & llvm::object::MinidumpFile::header ( ) const
inline

Returns the contents of the minidump header.

Definition at line 34 of file Minidump.h.

◆ streams()

ArrayRef< minidump::Directory > llvm::object::MinidumpFile::streams ( ) const
inline

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

Definition at line 37 of file Minidump.h.


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