Crashpad
Static Public Member Functions | Protected Member Functions | List of all members
crashpad::MinidumpContextWriter Class Referenceabstract

The base class for writers of CPU context structures in minidump files. More...

#include "minidump/minidump_context_writer.h"

Inheritance diagram for crashpad::MinidumpContextWriter:
crashpad::internal::MinidumpWritable crashpad::MinidumpContextAMD64Writer crashpad::MinidumpContextARM64Writer crashpad::MinidumpContextARMWriter crashpad::MinidumpContextMIPS64Writer crashpad::MinidumpContextMIPSWriter crashpad::MinidumpContextX86Writer

Static Public Member Functions

static std::unique_ptr< MinidumpContextWriterCreateFromSnapshot (const CPUContext *context_snapshot)
 Creates a MinidumpContextWriter based on context_snapshot. More...
 

Protected Member Functions

virtual size_t ContextSize () const =0
 Returns the size of the context structure that this object will write. More...
 
size_t SizeOfObject () final
 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...
 
- Protected Member Functions inherited from crashpad::internal::MinidumpWritable
State state () const
 The state of the object.
 
virtual bool Freeze ()
 Transitions the object from kStateMutable to kStateFrozen. 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

- 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 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 writers of CPU context structures in minidump files.

Member Function Documentation

◆ ContextSize()

virtual size_t crashpad::MinidumpContextWriter::ContextSize ( ) const
protectedpure virtual

Returns the size of the context structure that this object will write.

Note
This method will only be called in kStateFrozen or a subsequent state.

Implemented in crashpad::MinidumpContextMIPS64Writer, crashpad::MinidumpContextMIPSWriter, crashpad::MinidumpContextARM64Writer, crashpad::MinidumpContextARMWriter, crashpad::MinidumpContextAMD64Writer, and crashpad::MinidumpContextX86Writer.

◆ CreateFromSnapshot()

std::unique_ptr< MinidumpContextWriter > crashpad::MinidumpContextWriter::CreateFromSnapshot ( const CPUContext context_snapshot)
static

Creates a MinidumpContextWriter based on context_snapshot.

Parameters
[in]context_snapshotThe context snapshot to use as source data.
Returns
A MinidumpContextWriter subclass, such as MinidumpContextWriterX86 or MinidumpContextWriterAMD64, appropriate to the CPU type of context_snapshot. The returned object is initialized using the source data in context_snapshot. If context_snapshot is an unknown CPU type’s context, logs a message and returns nullptr.

◆ SizeOfObject()

size_t crashpad::MinidumpContextWriter::SizeOfObject ( )
finalprotectedvirtual

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.

Note
Valid in kStateFrozen or any subsequent state.

Implements crashpad::internal::MinidumpWritable.


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