Crashpad
|
A MinidumpMemoryWriter implementation used for testing. More...
#include "minidump/test/minidump_memory_writer_test_util.h"
Public Member Functions | |
TestMinidumpMemoryWriter (uint64_t base_address, size_t size, uint8_t value) | |
![]() | |
const MINIDUMP_MEMORY_DESCRIPTOR * | MinidumpMemoryDescriptor () const |
Returns a MINIDUMP_MEMORY_DESCRIPTOR referencing the data that this object writes. More... | |
void | RegisterMemoryDescriptor (MINIDUMP_MEMORY_DESCRIPTOR *memory_descriptor) |
Registers a memory descriptor as one that should point to the object on which this method is called. More... | |
![]() | |
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 | |
uint64_t | MemoryRangeBaseAddress () const override |
Returns the base address of the memory region in the address space of the process that the snapshot describes. More... | |
size_t | MemoryRangeSize () const override |
Returns the size of the memory region in bytes. More... | |
bool | WillWriteAtOffsetImpl (FileOffset offset) override |
Called once an object’s writable file offset is determined, as it transitions into kStateWritable. More... | |
bool | WriteObject (FileWriterInterface *file_writer) override |
Writes the object’s content. More... | |
![]() | |
bool | Freeze () override |
Transitions the object from kStateMutable to kStateFrozen. 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... | |
size_t | Alignment () override |
Returns the object’s desired byte-boundary alignment. More... | |
Phase | WritePhase () final |
Returns the object’s desired write phase. More... | |
![]() | |
State | state () const |
The state of the object. | |
virtual std::vector< MinidumpWritable * > | Children () |
Returns the object’s children. 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... | |
bool | WritePaddingAndObject (FileWriterInterface *file_writer) |
Writes the object, transitioning it from kStateWritable to kStateWritten. More... | |
Additional Inherited Members | |
![]() | |
static scoped_ptr< MinidumpMemoryWriter > | CreateFromSnapshot (const MemorySnapshot *memory_snapshot) |
Creates a concrete initialized MinidumpMemoryWriter based on memory_snapshot. More... | |
![]() | |
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 const size_t | kInvalidSize |
A size value used to signal failure by methods that return size_t . More... | |
A MinidumpMemoryWriter implementation used for testing.
TestMinidumpMemoryWriter objects are created with a fixed base address and size, and will write the same byte (value) repeatedly, size times.
|
overrideprotectedvirtual |
Returns the base address of the memory region in the address space of the process that the snapshot describes.
Implements crashpad::MinidumpMemoryWriter.
|
overrideprotectedvirtual |
Returns the size of the memory region in bytes.
Implements crashpad::MinidumpMemoryWriter.
|
overrideprotectedvirtual |
Called once an object’s writable file offset is determined, as it transitions into kStateWritable.
Subclasses can override this method if they need to provide additional processing once their writable file offset is known. Typically, this will be done by subclasses that handle certain RVAs themselves instead of using the RegisterRVA() interface.
[in] | offset | The file offset at which the object will be written. The value passed to this method will already have been adjusted to meet alignment requirements. |
true
on success. false
on error, indicating that the minidump file should not be written.Reimplemented from crashpad::MinidumpMemoryWriter.
|
overrideprotectedvirtual |
Writes the object’s content.
[in] | file_writer | The file writer to receive the object’s content. |
true
on success. false
on error, indicating that the content could not be written to the minidump file.Implements crashpad::internal::MinidumpWritable.