LLVM  10.0.0svn
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]
Collaboration diagram for llvm::object::MinidumpFile:
Collaboration graph
[legend]

Public Member Functions

const minidump::Headerheader () const
 Returns the contents of the minidump header. More...
 
ArrayRef< minidump::Directorystreams () const
 Returns the list of streams (stream directory entries) in this file. More...
 
ArrayRef< uint8_t > getRawStream (const minidump::Directory &Stream) const
 Returns the raw contents of the stream given by the directory entry. More...
 
Optional< ArrayRef< uint8_t > > getRawStream (minidump::StreamType Type) const
 Returns the raw contents of the stream of the given type, or None if the file does not contain a stream of this type. More...
 
Expected< ArrayRef< uint8_t > > getRawData (minidump::LocationDescriptor Desc) const
 Returns the raw contents of an object given by the LocationDescriptor. More...
 
Expected< std::string > getString (size_t Offset) const
 Returns the minidump string at the given offset. More...
 
Expected< const minidump::SystemInfo & > getSystemInfo () const
 Returns the contents of the SystemInfo stream, cast to the appropriate type. More...
 
Expected< ArrayRef< minidump::Module > > getModuleList () const
 Returns the module list embedded in the ModuleList stream. More...
 
Expected< ArrayRef< minidump::Thread > > getThreadList () const
 Returns the thread list embedded in the ThreadList stream. More...
 
Expected< ArrayRef< minidump::MemoryDescriptor > > getMemoryList () const
 Returns the list of memory ranges embedded in the MemoryList stream. More...
 
- Public Member Functions inherited from llvm::object::Binary
 Binary ()=delete
 
 Binary (const Binary &other)=delete
 
virtual ~Binary ()
 
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 isCOFFImportFile () const
 
bool isIR () 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. More...
 
static bool classof (const Binary *B)
 
- Static Public Member Functions inherited from llvm::object::Binary
static std::error_code 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_StartObjects, ID_COFF, ID_XCOFF32, ID_XCOFF64,
  ID_ELF32L, ID_ELF32B, ID_ELF64L, ID_ELF64B,
  ID_MachO32L, ID_MachO32B, ID_MachO64L, ID_MachO64B,
  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 22 of file Minidump.h.

Member Function Documentation

◆ classof()

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

Definition at line 29 of file Minidump.h.

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

◆ create()

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

◆ getMemoryList()

Expected<ArrayRef<minidump::MemoryDescriptor> > llvm::object::MinidumpFile::getMemoryList ( ) const
inline

Returns the list of memory ranges embedded in the MemoryList 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 memory descriptors declared in the stream header. The consistency of the MemoryDescriptor entries themselves is not checked in any way.

Definition at line 88 of file Minidump.h.

References llvm::arrayRefFromStringRef(), llvm::object::Binary::Binary(), llvm::object::Binary::Data, getRawStream(), llvm::object::Binary::ID_Minidump, llvm::max(), llvm::object::parse_failed, Size, T, and llvm::object::unexpected_eof.

Referenced by llvm::MinidumpYAML::Stream::create().

◆ 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 70 of file Minidump.h.

Referenced by llvm::MinidumpYAML::Stream::create().

◆ 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 49 of file Minidump.h.

References llvm::minidump::LocationDescriptor::DataSize, getString(), and llvm::minidump::LocationDescriptor::RVA.

Referenced by llvm::MinidumpYAML::Stream::create().

◆ 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 38 of file Minidump.h.

References llvm::minidump::LocationDescriptor::DataSize, llvm::minidump::Directory::Location, llvm::minidump::LocationDescriptor::RVA, and llvm::ArrayRef< T >::slice().

Referenced by llvm::MinidumpYAML::Stream::create(), and getMemoryList().

◆ getRawStream() [2/2]

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

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

Definition at line 18 of file Minidump.cpp.

References llvm::None.

◆ 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 25 of file Minidump.cpp.

References llvm::SmallVectorTemplateCommon< T >::begin(), llvm::convertUTF16ToUTF8String(), llvm::copy(), llvm::object::createError(), llvm::Data, Size, llvm::ArrayRef< T >::size(), llvm::size(), and llvm::ArrayRef< T >::slice().

Referenced by llvm::MinidumpYAML::Stream::create(), and getRawData().

◆ 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 61 of file Minidump.h.

Referenced by llvm::MinidumpYAML::Stream::create().

◆ 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 79 of file Minidump.h.

Referenced by llvm::MinidumpYAML::Stream::create().

◆ header()

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

Returns the contents of the minidump header.

Definition at line 32 of file Minidump.h.

Referenced by llvm::MinidumpYAML::Object::create().

◆ streams()

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

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

Definition at line 35 of file Minidump.h.

Referenced by llvm::MinidumpYAML::Object::create().


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