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

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

#include "snapshot/test/test_thread_snapshot.h"

Inheritance diagram for crashpad::test::TestThreadSnapshot:
crashpad::ThreadSnapshot

Public Member Functions

CPUContextMutableContext ()
 Obtains a pointer to the underlying mutable CPUContext structure. More...
 
void SetStack (std::unique_ptr< MemorySnapshot > stack)
 Sets the memory region to be returned by Stack(). More...
 
void SetThreadID (uint64_t thread_id)
 
void SetSuspendCount (int suspend_count)
 
void SetPriority (int priority)
 
void SetThreadSpecificDataAddress (uint64_t thread_specific_data_address)
 
void AddExtraMemory (std::unique_ptr< MemorySnapshot > extra_memory)
 Add a memory snapshot to be returned by ExtraMemory(). More...
 
const CPUContextContext () const override
 Returns a CPUContext object corresponding to the thread’s CPU context. More...
 
const MemorySnapshotStack () const override
 Returns a MemorySnapshot object corresponding to the memory region that contains the thread’s stack, or nullptr if no stack region is available. More...
 
uint64_t ThreadID () const override
 Returns the thread’s identifier. More...
 
int SuspendCount () const override
 Returns the thread’s suspend count. More...
 
int Priority () const override
 Returns the thread’s priority. More...
 
uint64_t ThreadSpecificDataAddress () const override
 Returns the base address of a region used to store thread-specific data.
 
std::vector< const MemorySnapshot * > ExtraMemory () const override
 Returns a vector of additional memory blocks that should be included in a minidump. More...
 

Detailed Description

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

Member Function Documentation

◆ AddExtraMemory()

void crashpad::test::TestThreadSnapshot::AddExtraMemory ( std::unique_ptr< MemorySnapshot extra_memory)
inline

Add a memory snapshot to be returned by ExtraMemory().

Parameters
[in]extra_memoryThe memory snapshot that will be included in ExtraMemory(). The TestThreadSnapshot object takes ownership of extra_memory.

◆ Context()

const CPUContext * crashpad::test::TestThreadSnapshot::Context ( ) const
overridevirtual

Returns a CPUContext object corresponding to the thread’s CPU context.

The caller does not take ownership of this object, it is scoped to the lifetime of the ThreadSnapshot object that it was obtained from.

Implements crashpad::ThreadSnapshot.

◆ ExtraMemory()

std::vector< const MemorySnapshot * > crashpad::test::TestThreadSnapshot::ExtraMemory ( ) const
overridevirtual

Returns a vector of additional memory blocks that should be included in a minidump.

Returns
A vector of MemorySnapshot objects that will be included in the crash dump. The caller does not take ownership of these objects, they are scoped to the lifetime of the ThreadSnapshot object that they were obtained from.

Implements crashpad::ThreadSnapshot.

◆ MutableContext()

CPUContext* crashpad::test::TestThreadSnapshot::MutableContext ( )
inline

Obtains a pointer to the underlying mutable CPUContext structure.

This method is intended to be used by callers to populate the CPUContext structure.

Returns
The same pointer that Context() does, while treating the data as mutable.
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.

◆ Priority()

int crashpad::test::TestThreadSnapshot::Priority ( ) const
overridevirtual

Returns the thread’s priority.

Threads with higher priorities will have higher priority values.

Implements crashpad::ThreadSnapshot.

◆ SetStack()

void crashpad::test::TestThreadSnapshot::SetStack ( std::unique_ptr< MemorySnapshot stack)
inline

Sets the memory region to be returned by Stack().

Parameters
[in]stackThe memory region that Stack() will return. The TestThreadSnapshot object takes ownership of stack.

◆ Stack()

const MemorySnapshot * crashpad::test::TestThreadSnapshot::Stack ( ) const
overridevirtual

Returns a MemorySnapshot object corresponding to the memory region that contains the thread’s stack, or nullptr if no stack region is available.

The caller does not take ownership of this object, it is scoped to the lifetime of the ThreadSnapshot object that it was obtained from.

Implements crashpad::ThreadSnapshot.

◆ SuspendCount()

int crashpad::test::TestThreadSnapshot::SuspendCount ( ) const
overridevirtual

Returns the thread’s suspend count.

A suspend count of 0 denotes a schedulable (not suspended) thread.

Implements crashpad::ThreadSnapshot.

◆ ThreadID()

uint64_t crashpad::test::TestThreadSnapshot::ThreadID ( ) const
overridevirtual

Returns the thread’s identifier.

Thread identifiers are at least unique within a process, and may be unique system-wide.

Implements crashpad::ThreadSnapshot.


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