Crashpad
Protected Member Functions | List of all members
crashpad::internal::MinidumpRVAListWriter Class Reference

The writer for a MinidumpRVAList object in a minidump file, containing a list of RVA pointers. More...

#include "minidump/minidump_rva_list_writer.h"

Inheritance diagram for crashpad::internal::MinidumpRVAListWriter:
crashpad::internal::MinidumpWritable crashpad::internal::MinidumpStringListWriter< MinidumpStringWriterType >

Protected Member Functions

void AddChild (std::unique_ptr< MinidumpWritable > child)
 Adds an RVA referencing an MinidumpWritable to the MinidumpRVAList. More...
 
bool IsEmpty () const
 Returns true if no child objects have been added by AddChild(), and false if child objects are present.
 
const std::vector< RVA > & child_rvas () const
 Returns an object’s RVA objects referencing its children. More...
 
bool Freeze () override
 Transitions the object from kStateMutable to kStateFrozen. More...
 
size_t SizeOfObject () override
 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...
 
std::vector< MinidumpWritable * > Children () override
 Returns the object’s children. More...
 
bool WriteObject (FileWriterInterface *file_writer) override
 Writes the object’s content. More...
 
- Protected Member Functions inherited from crashpad::internal::MinidumpWritable
State state () const
 The state of the object.
 
virtual size_t Alignment ()
 Returns the object’s desired byte-boundary alignment. 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

- 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 writer for a MinidumpRVAList object in a minidump file, containing a list of RVA pointers.

Member Function Documentation

◆ AddChild()

void crashpad::internal::MinidumpRVAListWriter::AddChild ( std::unique_ptr< MinidumpWritable child)
protected

Adds an RVA referencing an MinidumpWritable to the MinidumpRVAList.

This object takes ownership of child and becomes its parent in the overall tree of MinidumpWritable objects.

To provide type-correctness, subclasses are expected to provide a public method that accepts a scoped_ptr-wrapped argument of the proper MinidumpWritable subclass, and call this method with that argument.

Note
Valid in kStateMutable.

◆ child_rvas()

const std::vector<RVA>& crashpad::internal::MinidumpRVAListWriter::child_rvas ( ) const
inlineprotected

Returns an object’s RVA objects referencing its children.

Note
The returned vector will be empty until the object advances to kStateFrozen or beyond.

◆ Children()

std::vector< MinidumpWritable * > crashpad::internal::MinidumpRVAListWriter::Children ( )
overrideprotectedvirtual

Returns the object’s children.

Note
Valid in kStateFrozen or any subsequent state.

Reimplemented from crashpad::internal::MinidumpWritable.

◆ Freeze()

bool crashpad::internal::MinidumpRVAListWriter::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.

◆ SizeOfObject()

size_t crashpad::internal::MinidumpRVAListWriter::SizeOfObject ( )
overrideprotectedvirtual

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.

◆ WriteObject()

bool crashpad::internal::MinidumpRVAListWriter::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: