Crashpad
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
crashpad::MinidumpContextAMD64Writer Class Referencefinal

The writer for a MinidumpContextAMD64 structure in a minidump file. More...

#include "minidump/minidump_context_writer.h"

Inheritance diagram for crashpad::MinidumpContextAMD64Writer:
crashpad::MinidumpContextWriter crashpad::internal::MinidumpWritable

Public Member Functions

void InitializeFromSnapshot (const CPUContextX86_64 *context_snapshot)
 Initializes the MinidumpContextAMD64 based on context_snapshot. More...
 
MinidumpContextAMD64context ()
 Returns a pointer to the context structure that this object will write. 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...
 

Static Public Member Functions

static void * operator new (size_t size)
 
static void operator delete (void *ptr)
 
static void * operator new[] (size_t size)=delete
 
static void operator delete[] (void *ptr)=delete
 
- Static Public Member Functions inherited from crashpad::MinidumpContextWriter
static std::unique_ptr< MinidumpContextWriterCreateFromSnapshot (const CPUContext *context_snapshot)
 Creates a MinidumpContextWriter based on context_snapshot. More...
 

Protected Member Functions

size_t Alignment () override
 Returns the object’s desired byte-boundary alignment. More...
 
bool WriteObject (FileWriterInterface *file_writer) override
 Writes the object’s content. More...
 
size_t ContextSize () const override
 Returns the size of the context structure that this object will write. More...
 
- Protected Member Functions inherited from crashpad::MinidumpContextWriter
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 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...
 

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 writer for a MinidumpContextAMD64 structure in a minidump file.

Member Function Documentation

◆ Alignment()

size_t crashpad::MinidumpContextAMD64Writer::Alignment ( )
overrideprotectedvirtual

Returns the object’s desired byte-boundary alignment.

The default implementation returns 4. Subclasses may override this as needed.

Note
Valid in kStateFrozen or any subsequent state.

Reimplemented from crashpad::internal::MinidumpWritable.

◆ context()

MinidumpContextAMD64* crashpad::MinidumpContextAMD64Writer::context ( )
inline

Returns a pointer to the context structure that this object will write.

Attention
This returns a non-const pointer to this object’s private data so that a caller can populate the context structure directly. This is done because providing setter interfaces to each field in the context structure would be unwieldy and cumbersome. Care must be taken to populate the context structure correctly. The context structure must only be modified while this object is in the kStateMutable state.

◆ ContextSize()

size_t crashpad::MinidumpContextAMD64Writer::ContextSize ( ) const
overrideprotectedvirtual

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.

Implements crashpad::MinidumpContextWriter.

◆ InitializeFromSnapshot()

void crashpad::MinidumpContextAMD64Writer::InitializeFromSnapshot ( const CPUContextX86_64 context_snapshot)

Initializes the MinidumpContextAMD64 based on context_snapshot.

Parameters
[in]context_snapshotThe context snapshot to use as source data.
Note
Valid in kStateMutable. No mutation of context() may be done before calling this method, and it is not normally necessary to alter context() after calling this method.

◆ WriteObject()

bool crashpad::MinidumpContextAMD64Writer::WriteObject ( FileWriterInterface file_writer)
overrideprotectedvirtual

Writes the object’s content.

Parameters
[in]file_writerThe file writer to receive the object’s content.
Returns
true on success. false on error, indicating that the content could not be written to the minidump file.
Note
Valid in kStateWritable. The object will transition to kStateWritten after this method returns.

Implements crashpad::internal::MinidumpWritable.


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