Crashpad

Public Member Functions | List of all members
crashpad::test::TestMemorySnapshot Class Referencefinal

A test MemorySnapshot that can carry arbitrary data for testing purposes. More...

`#include "snapshot/test/test_memory_snapshot.h"`

Inheritance diagram for crashpad::test::TestMemorySnapshot:

## Public Member Functions
void | SetAddress (uint64_t address)
void | SetSize (size_t size)
void | SetValue (char value)
| Sets the value to fill the test memory region with. More...
uint64_t | Address () const override
| The base address of the memory snapshot in the snapshot process’ address space.
size_t | Size () const override
| The size of the memory snapshot.
bool | Read (Delegate *delegate) const override
| Calls Delegate::MemorySnapshotDelegateRead(), providing it with the memory snapshot’s data. More...

## Detailed Description

A test MemorySnapshot that can carry arbitrary data for testing purposes.

## Member Function Documentation

## ◆ Read()

bool crashpad::test::TestMemorySnapshot::Read | ( | Delegate * | delegate | ) | const
| override virtual

Calls Delegate::MemorySnapshotDelegateRead(), providing it with the memory snapshot’s data.

Implementations do not necessarily read the memory snapshot data prior to this method being called. Memory snapshot data may be loaded lazily and may be discarded after being passed to the delegate. This provides clean memory management without burdening a snapshot implementation with the requirement that it track all memory region data simultaneously.

Returns
  `false` on failure, otherwise, the return value of Delegate::MemorySnapshotDelegateRead(), which should be `true` on success and `false` on failure.

Implements crashpad::MemorySnapshot.

## ◆ SetValue()

void crashpad::test::TestMemorySnapshot::SetValue | ( | char | value | ) |
| inline

Sets the value to fill the test memory region with.

Parameters

  [in] | value | The value to be written to delegate when Read() is called. This value will be repeated Size() times.

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

- snapshot/test/test_memory_snapshot.h
- snapshot/test/test_memory_snapshot.cc