class ProcessSnapshot

Defined at line 49 of file ../../third_party/crashpad/src/snapshot/process_snapshot.h

An abstract interface to a snapshot representing the state of a

process.

This is the top-level object in a family of Snapshot objects, because it

gives access to a SystemSnapshot, vectors of ModuleSnapshot and

ThreadSnapshot objects, and possibly an ExceptionSnapshot. In turn,

ThreadSnapshot and ExceptionSnapshot objects both give access to CPUContext

objects, and ThreadSnapshot objects also give access to MemorySnapshot

objects corresponding to thread stacks.

Public Methods

crashpad::ProcessID ProcessID ()

Returns the snapshot process’ process ID.

crashpad::ProcessID ParentProcessID ()

Returns the snapshot process’ parent process’ process ID.

void SnapshotTime (timeval * snapshot_time)

Returns the time that the snapshot was taken in

Parameters

snapshot_time [out] The time that the snapshot was taken. This is distinct from the time that a ProcessSnapshot object was created or initialized, although it may be that time for ProcessSnapshot objects representing live or recently-crashed process state.
void ProcessStartTime (timeval * start_time)

Returns the time that the snapshot process was started in

Normally, process uptime in wall clock time can be computed as

SnapshotTime() − ProcessStartTime(), but this cannot be guaranteed in

cases where the real-time clock has been set during the snapshot process’

lifetime.

Parameters

start_time [out] The time that the process was started.
void ProcessCPUTimes (timeval * user_time, timeval * system_time)

Returns the snapshot process’ CPU usage times in

and

Parameters

user_time [out] The time that the process has spent executing in user mode.
system_time [out] The time that the process has spent executing in system (kernel) mode.
void ReportID (UUID * client_id)

Returns a %UUID identifying the event that the snapshot describes.

This provides a stable identifier for a crash even as the report is

converted to different formats, provided that all formats support storing

a crash report ID. When a report is originally created, a report ID should

be assigned. From that point on, any operations involving the same report

should preserve the same report ID.

If no identifier is available, this field will contain zeroes.

void ClientID (UUID * client_id)

Returns a %UUID identifying the client that the snapshot

represents.

Client identification is within the scope of the application, but it is

expected that the identifier will be unique for an instance of Crashpad

monitoring an application or set of applications for a user. The

identifier shall remain stable over time.

If no identifier is available, this field will contain zeroes.

const std::map<std::string, std::string> & AnnotationsSimpleMap ()

Returns key-value string annotations recorded for the process,

system, or snapshot producer.

This method retrieves annotations recorded for a process. These

annotations are intended for diagnostic use, including crash analysis.

“Simple annotations” are structured as a sequence of key-value pairs,

where all keys and values are strings. These are referred to in Chrome as

“crash keys.”

Annotations stored here may reflect the process, system, or snapshot

producer. Most annotations not under the client’s direct control will be

retrievable by this method. For clients such as Chrome, this includes the

product name and version.

Additional per-module annotations may be obtained by calling

ModuleSnapshot::AnnotationsSimpleMap().

This interface currently returns a const

&

because all implementations store

the data within their objects in this format, and are therefore able to

provide this access without requiring a copy. Future implementations may

obtain data on demand or store data in a different format, at which point

the cost of maintaining this data in ProcessSnapshot subclass objects will

need to be taken into account, and this interface possibly revised.

const SystemSnapshot * System ()

Returns a SystemSnapshot reflecting the characteristics of the

system that ran the snapshot process at the time of the snapshot.

Returns

A SystemSnapshot object. The caller does not take ownership of

this object, it is scoped to the lifetime of the ProcessSnapshot

object that it was obtained from.

std::vector<const ModuleSnapshot *> Modules ()

Returns ModuleSnapshot objects reflecting the code modules (binary

images) loaded into the snapshot process at the time of the snapshot.

Returns

A vector of ModuleSnapshot objects. The caller does not take

ownership of these objects, they are scoped to the lifetime of the

ProcessSnapshot object that they were obtained from.

std::vector<UnloadedModuleSnapshot> UnloadedModules ()

Returns UnloadedModuleSnapshot objects reflecting the code modules

the were recorded as unloaded at the time of the snapshot.

Returns

A vector of UnloadedModuleSnapshot objects.

std::vector<const ThreadSnapshot *> Threads ()

Returns ThreadSnapshot objects reflecting the threads (lightweight

processes) existing in the snapshot process at the time of the

snapshot.

Returns

A vector of ThreadSnapshot objects. The caller does not take

ownership of these objects, they are scoped to the lifetime of the

ProcessSnapshot object that they were obtained from.

const ExceptionSnapshot * Exception ()

Returns an ExceptionSnapshot reflecting the exception that the

snapshot process sustained to trigger the snapshot being taken.

Returns

An ExceptionSnapshot object. The caller does not take ownership of

this object, it is scoped to the lifetime of the ProcessSnapshot

object that it was obtained from. If the snapshot is not a result of

an exception, returns `nullptr`.

std::vector<const MemoryMapRegionSnapshot *> MemoryMap ()

Returns MemoryMapRegionSnapshot objects reflecting the regions

of the memory map in the snapshot process at the time of the snapshot.

Returns

A vector of MemoryMapRegionSnapshot objects. The caller does not

take ownership of these objects, they are scoped to the lifetime of

the ProcessSnapshot object that they were obtained from.

std::vector<HandleSnapshot> Handles ()

Returns HandleSnapshot objects reflecting the open handles in the

snapshot process at the time of the snapshot.

Returns

A vector of HandleSnapshot objects.

std::vector<const MemorySnapshot *> ExtraMemory ()

Returns a vector of additional memory blocks that should be

included in a minidump.

Returns

An 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 ProcessSnapshot object that they

were obtained from.

const ProcessMemory * Memory ()

Returns a ProcessMemory object that allows accessing the process'

memory directly.

Returns

A ProcessMemory object. The caller does not take ownership of this

object, it is scoped to the lifetime of the ProcessSnapshot object

that it was obtained from.

void ~ProcessSnapshot ()

Defined at line 51 of file ../../third_party/crashpad/src/snapshot/process_snapshot.h