Crashpad
Public Member Functions | Protected Member Functions | List of all members
crashpad::internal::MinidumpStreamWriter Class Referenceabstract

The base class for all second-level objects (“streams”) in a minidump file. More...

#include "minidump/minidump_stream_writer.h"

Inheritance diagram for crashpad::internal::MinidumpStreamWriter:
crashpad::internal::MinidumpWritable crashpad::MinidumpCrashpadInfoWriter crashpad::MinidumpExceptionWriter crashpad::MinidumpHandleDataWriter crashpad::MinidumpMemoryInfoListWriter crashpad::MinidumpMemoryListWriter crashpad::MinidumpMiscInfoWriter crashpad::MinidumpModuleListWriter crashpad::MinidumpSystemInfoWriter crashpad::MinidumpThreadListWriter crashpad::MinidumpUnloadedModuleListWriter crashpad::MinidumpUserStreamWriter

Public Member Functions

virtual MinidumpStreamType StreamType () const =0
 Returns an object’s stream type. More...
 
const MINIDUMP_DIRECTORYDirectoryListEntry () const
 Returns a MINIDUMP_DIRECTORY entry that serves as a pointer to this stream. More...
 
- Public Member Functions inherited from crashpad::internal::MinidumpWritable
virtual bool WriteEverything (FileWriterInterface *file_writer)
 Writes an object and all of its children to a minidump file. More...
 
void RegisterRVA (RVA *rva)
 Registers a file offset pointer as one that should point to the object on which this method is called. More...
 
void RegisterLocationDescriptor (MINIDUMP_LOCATION_DESCRIPTOR *location_descriptor)
 Registers a location descriptor as one that should point to the object on which this method is called. More...
 

Protected Member Functions

bool Freeze () override
 Transitions the object from kStateMutable to kStateFrozen. More...
 
- Protected Member Functions inherited from crashpad::internal::MinidumpWritable
State state () const
 The state of the object.
 
virtual size_t SizeOfObject ()=0
 Returns the amount of space that this object will consume when written to a minidump file, in bytes, not including any leading or trailing padding necessary to maintain proper alignment. More...
 
virtual size_t Alignment ()
 Returns the object’s desired byte-boundary alignment. More...
 
virtual std::vector< MinidumpWritable * > Children ()
 Returns the object’s children. More...
 
virtual Phase WritePhase ()
 Returns the object’s desired write phase. More...
 
size_t WillWriteAtOffset (Phase phase, FileOffset *offset, std::vector< MinidumpWritable * > *write_sequence)
 Prepares the object to be written at a known file offset, transitioning it from kStateFrozen to kStateWritable. More...
 
virtual bool WillWriteAtOffsetImpl (FileOffset offset)
 Called once an object’s writable file offset is determined, as it transitions into kStateWritable. More...
 
bool WritePaddingAndObject (FileWriterInterface *file_writer)
 Writes the object, transitioning it from kStateWritable to kStateWritten. More...
 
virtual bool WriteObject (FileWriterInterface *file_writer)=0
 Writes the object’s content. More...
 

Additional Inherited Members

- Protected Types inherited from crashpad::internal::MinidumpWritable
enum  State
 Identifies the state of an object. More...
 
enum  Phase
 Identifies the phase during which an object will be written to a minidump file. More...
 
- Static Protected Attributes inherited from crashpad::internal::MinidumpWritable
static constexpr size_t kInvalidSize = std::numeric_limits<size_t>::max()
 A size value used to signal failure by methods that return size_t.
 

Detailed Description

The base class for all second-level objects (“streams”) in a minidump file.

Instances of subclasses of this class are children of the root-level MinidumpFileWriter object.

Member Function Documentation

◆ DirectoryListEntry()

const MINIDUMP_DIRECTORY * crashpad::internal::MinidumpStreamWriter::DirectoryListEntry ( ) const

Returns a MINIDUMP_DIRECTORY entry that serves as a pointer to this stream.

This method is provided for MinidumpFileWriter, which calls it in order to obtain the directory entry for a stream.

Note
Valid only in kStateWritable.

◆ Freeze()

bool crashpad::internal::MinidumpStreamWriter::Freeze ( )
overrideprotectedvirtual

Transitions the object from kStateMutable to kStateFrozen.

The default implementation marks the object as frozen and recursively calls Freeze() on all of its children. Subclasses may override this method to perform processing that should only be done once callers have finished populating an object with data. Typically, a subclass implementation would call RegisterRVA() or RegisterLocationDescriptor() on other objects as appropriate, because at the time Freeze() runs, the in-memory locations of RVAs and location descriptors are known and will not change for the remaining duration of an object’s lifetime.

Returns
true on success. false on failure, with an appropriate message logged.

Reimplemented from crashpad::internal::MinidumpWritable.

Reimplemented in crashpad::MinidumpThreadListWriter, crashpad::MinidumpSystemInfoWriter, crashpad::MinidumpUnloadedModuleListWriter, and crashpad::MinidumpUserStreamWriter.

◆ StreamType()

virtual MinidumpStreamType crashpad::internal::MinidumpStreamWriter::StreamType ( ) const
pure virtual

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