Crashpad

Public Member Functions | List of all members
crashpad::ProcessSnapshot Class Referenceabstract

An abstract interface to a snapshot representing the state of a process. More...

`#include "snapshot/process_snapshot.h"`

Inheritance diagram for crashpad::ProcessSnapshot:

## Public Member Functions
virtual pid_t | ProcessID () const =0
| Returns the snapshot process’ process ID.
virtual pid_t | ParentProcessID () const =0
| Returns the snapshot process’ parent process’ process ID.
virtual void | SnapshotTime (timeval *snapshot_time) const =0
| Returns the time that the snapshot was taken in snapshot_time. More...
virtual void | ProcessStartTime (timeval *start_time) const =0
| Returns the time that the snapshot process was started in start_time. More...
virtual void | ProcessCPUTimes (timeval *user_time, timeval *system_time) const =0
| Returns the snapshot process’ CPU usage times in user_time and system_time. More...
virtual void | ReportID (UUID *client_id) const =0
| Returns a UUID identifying the event that the snapshot describes. More...
virtual void | ClientID (UUID *client_id) const =0
| Returns a UUID identifying the client that the snapshot represents. More...
virtual const std::map< std::string, std::string > & | AnnotationsSimpleMap () const =0
| Returns key-value string annotations recorded for the process, system, or snapshot producer. More...
virtual const SystemSnapshot * | System () const =0
| Returns a SystemSnapshot reflecting the characteristics of the system that ran the snapshot process at the time of the snapshot. More...
virtual std::vector< const ModuleSnapshot * > | Modules () const =0
| Returns ModuleSnapshot objects reflecting the code modules (binary images) loaded into the snapshot process at the time of the snapshot. More...
virtual std::vector< UnloadedModuleSnapshot > | UnloadedModules () const =0
| Returns UnloadedModuleSnapshot objects reflecting the code modules the were recorded as unloaded at the time of the snapshot. More...
virtual std::vector< const ThreadSnapshot * > | Threads () const =0
| Returns ThreadSnapshot objects reflecting the threads (lightweight processes) existing in the snapshot process at the time of the snapshot. More...
virtual const ExceptionSnapshot * | Exception () const =0
| Returns an ExceptionSnapshot reflecting the exception that the snapshot process sustained to trigger the snapshot being taken. More...
virtual std::vector< const MemoryMapRegionSnapshot * > | MemoryMap () const =0
| Returns MemoryMapRegionSnapshot objects reflecting the regions of the memory map in the snapshot process at the time of the snapshot. More...
virtual std::vector< HandleSnapshot > | Handles () const =0
| Returns HandleSnapshot objects reflecting the open handles in the snapshot process at the time of the snapshot. More...
virtual std::vector< const MemorySnapshot * > | ExtraMemory () const =0
| Returns a vector of additional memory blocks that should be included in a minidump. More...

## Detailed Description

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.

## Member Function Documentation

## ◆ AnnotationsSimpleMap()

virtual const std::map<std::string, std::string>& crashpad::ProcessSnapshot::AnnotationsSimpleMap | ( |  | ) | const
| pure virtual

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().

Implemented in crashpad::test::TestProcessSnapshot, crashpad::ProcessSnapshotMac, crashpad::ProcessSnapshotWin, and crashpad::ProcessSnapshotMinidump.

## ◆ ClientID()

virtual void crashpad::ProcessSnapshot::ClientID | ( | UUID * | client_id | ) | const
| pure virtual

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.

Implemented in crashpad::test::TestProcessSnapshot, crashpad::ProcessSnapshotMac, crashpad::ProcessSnapshotWin, and crashpad::ProcessSnapshotMinidump.

## ◆ Exception()

virtual const ExceptionSnapshot* crashpad::ProcessSnapshot::Exception | ( |  | ) | const
| pure virtual

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`.

Implemented in crashpad::test::TestProcessSnapshot, crashpad::ProcessSnapshotMac, crashpad::ProcessSnapshotWin, and crashpad::ProcessSnapshotMinidump.

## ◆ ExtraMemory()

virtual std::vector<const MemorySnapshot*> crashpad::ProcessSnapshot::ExtraMemory | ( |  | ) | const
| pure virtual

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.

Implemented in crashpad::test::TestProcessSnapshot, crashpad::ProcessSnapshotMac, crashpad::ProcessSnapshotWin, and crashpad::ProcessSnapshotMinidump.

## ◆ Handles()

virtual std::vector<HandleSnapshot> crashpad::ProcessSnapshot::Handles | ( |  | ) | const
| pure virtual

Returns HandleSnapshot objects reflecting the open handles in the snapshot process at the time of the snapshot.

Returns
  A vector of HandleSnapshot objects.

Implemented in crashpad::test::TestProcessSnapshot, crashpad::ProcessSnapshotMac, crashpad::ProcessSnapshotWin, and crashpad::ProcessSnapshotMinidump.

## ◆ MemoryMap()

virtual std::vector<const MemoryMapRegionSnapshot*> crashpad::ProcessSnapshot::MemoryMap | ( |  | ) | const
| pure virtual

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.

Implemented in crashpad::test::TestProcessSnapshot, crashpad::ProcessSnapshotMac, crashpad::ProcessSnapshotWin, and crashpad::ProcessSnapshotMinidump.

## ◆ Modules()

virtual std::vector<const ModuleSnapshot*> crashpad::ProcessSnapshot::Modules | ( |  | ) | const
| pure virtual

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.

Implemented in crashpad::test::TestProcessSnapshot, crashpad::ProcessSnapshotMac, crashpad::ProcessSnapshotWin, and crashpad::ProcessSnapshotMinidump.

## ◆ ProcessCPUTimes()

virtual void crashpad::ProcessSnapshot::ProcessCPUTimes | ( | timeval * | user_time,
|  | timeval * | system_time
| ) |  | const
| pure virtual

Returns the snapshot process’ CPU usage times in user_time and system_time.

Parameters

  [out] | user_time | The time that the process has spent executing in user mode.
  [out] | system_time | The time that the process has spent executing in system (kernel) mode.

Implemented in crashpad::test::TestProcessSnapshot, crashpad::ProcessSnapshotMac, crashpad::ProcessSnapshotWin, and crashpad::ProcessSnapshotMinidump.

## ◆ ProcessStartTime()

virtual void crashpad::ProcessSnapshot::ProcessStartTime | ( | timeval * | start_time | ) | const
| pure virtual

Returns the time that the snapshot process was started in start_time.

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

  [out] | start_time | The time that the process was started.

Implemented in crashpad::test::TestProcessSnapshot, crashpad::ProcessSnapshotMac, crashpad::ProcessSnapshotWin, and crashpad::ProcessSnapshotMinidump.

## ◆ ReportID()

virtual void crashpad::ProcessSnapshot::ReportID | ( | UUID * | client_id | ) | const
| pure virtual

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.

Implemented in crashpad::test::TestProcessSnapshot, crashpad::ProcessSnapshotMac, crashpad::ProcessSnapshotWin, and crashpad::ProcessSnapshotMinidump.

## ◆ SnapshotTime()

virtual void crashpad::ProcessSnapshot::SnapshotTime | ( | timeval * | snapshot_time | ) | const
| pure virtual

Returns the time that the snapshot was taken in snapshot_time.

Parameters

  [out] | snapshot_time | 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.

Implemented in crashpad::test::TestProcessSnapshot, crashpad::ProcessSnapshotMac, crashpad::ProcessSnapshotWin, and crashpad::ProcessSnapshotMinidump.

## ◆ System()

virtual const SystemSnapshot* crashpad::ProcessSnapshot::System | ( |  | ) | const
| pure virtual

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.

Implemented in crashpad::test::TestProcessSnapshot, crashpad::ProcessSnapshotMac, crashpad::ProcessSnapshotWin, and crashpad::ProcessSnapshotMinidump.

## ◆ Threads()

virtual std::vector<const ThreadSnapshot*> crashpad::ProcessSnapshot::Threads | ( |  | ) | const
| pure virtual

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.

Implemented in crashpad::test::TestProcessSnapshot, crashpad::ProcessSnapshotMac, crashpad::ProcessSnapshotWin, and crashpad::ProcessSnapshotMinidump.

## ◆ UnloadedModules()

virtual std::vector<UnloadedModuleSnapshot> crashpad::ProcessSnapshot::UnloadedModules | ( |  | ) | const
| pure virtual

Returns UnloadedModuleSnapshot objects reflecting the code modules the were recorded as unloaded at the time of the snapshot.

Returns
  A vector of UnloadedModuleSnapshot objects.

Implemented in crashpad::test::TestProcessSnapshot, crashpad::ProcessSnapshotMac, crashpad::ProcessSnapshotWin, and crashpad::ProcessSnapshotMinidump.

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

- snapshot/process_snapshot.h