Crashpad
Classes | Public Member Functions | List of all members
crashpad::MemorySnapshot Class Referenceabstract

An abstract interface to a snapshot representing a region of memory present in a snapshot process. More...

#include "snapshot/memory_snapshot.h"

Inheritance diagram for crashpad::MemorySnapshot:
crashpad::internal::MemorySnapshotGeneric crashpad::internal::MemorySnapshotIOS crashpad::internal::MemorySnapshotMinidump crashpad::internal::MemorySnapshotSanitized crashpad::test::TestMemorySnapshot

Classes

class  Delegate
 An interface that MemorySnapshot clients must implement in order to receive memory snapshot data. More...
 

Public Member Functions

virtual uint64_t Address () const =0
 The base address of the memory snapshot in the snapshot process’ address space.
 
virtual size_t Size () const =0
 The size of the memory snapshot.
 
virtual bool Read (Delegate *delegate) const =0
 Calls Delegate::MemorySnapshotDelegateRead(), providing it with the memory snapshot’s data. More...
 
virtual const MemorySnapshotMergeWithOtherSnapshot (const MemorySnapshot *other) const =0
 Creates a new MemorySnapshot based on merging this one with other. More...
 

Detailed Description

An abstract interface to a snapshot representing a region of memory present in a snapshot process.

Member Function Documentation

◆ MergeWithOtherSnapshot()

virtual const MemorySnapshot* crashpad::MemorySnapshot::MergeWithOtherSnapshot ( const MemorySnapshot other) const
pure virtual

Creates a new MemorySnapshot based on merging this one with other.

The ranges described by the two snapshots must either overlap or abut, and must be of the same concrete type.

Returns
A newly allocated MemorySnapshot representing the merged range, or nullptr with an error logged.

Implemented in crashpad::internal::MemorySnapshotGeneric, crashpad::internal::MemorySnapshotSanitized, crashpad::test::TestMemorySnapshot, crashpad::internal::MemorySnapshotMinidump, and crashpad::internal::MemorySnapshotIOS.

◆ Read()

virtual bool crashpad::MemorySnapshot::Read ( Delegate delegate) const
pure 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.

Implemented in crashpad::internal::MemorySnapshotGeneric, crashpad::internal::MemorySnapshotSanitized, crashpad::test::TestMemorySnapshot, crashpad::internal::MemorySnapshotMinidump, and crashpad::internal::MemorySnapshotIOS.


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