# Crashpad: crashpad::ProcessReader Class Reference

crashpad::ProcessReader Class Reference

Accesses information about another process, identified by a Mach task. More...

`#include "snapshot/mac/process_reader.h"`

## Classes

struct | Module
| Contains information about a module loaded into a process. More...
struct | Thread
| Contains information about a thread that belongs to a task (process). More...

## Public Member Functions

bool | Initialize (task_t task)
| Initializes this object. This method must be called before any other. More...
bool | Is64Bit () const
pid_t | ProcessID () const
pid_t | ParentProcessID () const
void | StartTime (timeval *start_time) const
| Determines the target process’ start time. More...
bool | CPUTimes (timeval *user_time, timeval *system_time) const
| Determines the target process’ execution time. More...
TaskMemory * | Memory ()
const std::vector< Thread > & | Threads ()
const std::vector< Module > & | Modules ()

## Detailed Description

Accesses information about another process, identified by a Mach task.

## Member Function Documentation

## CPUTimes()

bool crashpad::ProcessReader::CPUTimes | ( | timeval * | user_time,
|  | timeval * | system_time
| ) |  | const

Determines the target process’ execution time.

Parameters

  [out] | user_time | The amount of time the process has executed code in user mode.
  [out] | system_time | The amount of time the process has executed code in system mode.

Returns
  `true` on success, `false` on failure, with a warning logged. On failure, user_time and system_time will be set to represent no time spent executing code in user or system mode.

## Initialize()

bool crashpad::ProcessReader::Initialize | ( | task_t | task | ) |

Initializes this object. This method must be called before any other.

Parameters

  [in] | task | A send right to the target task’s task port. This object does not take ownership of the send right.

Returns
  `true` on success, indicating that this object will respond validly to further method calls. `false` on failure. On failure, no further method calls should be made.

## Is64Bit()

bool crashpad::ProcessReader::Is64Bit | ( |  | ) | const

inline

Returns
  `true` if the target task is a 64-bit process.

## Memory()

TaskMemory* crashpad::ProcessReader::Memory | ( |  | ) |

inline

Returns
  Accesses the memory of the target task.

## Modules()

const std::vector< ProcessReader::Module > & crashpad::ProcessReader::Modules | ( |  | ) |

Returns
  The modules loaded in the process. The first element (at index `0`) corresponds to the main executable, and the final element corresponds to the dynamic loader, dyld.

## ParentProcessID()

pid_t crashpad::ProcessReader::ParentProcessID | ( |  | ) | const

inline

Returns
  The target task’s parent process ID.

## ProcessID()

pid_t crashpad::ProcessReader::ProcessID | ( |  | ) | const

inline

Returns
  The target task’s process ID.

## StartTime()

void crashpad::ProcessReader::StartTime | ( | timeval * | start_time | ) | const

Determines the target process’ start time.

Parameters

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

## Threads()

const std::vector< ProcessReader::Thread > & crashpad::ProcessReader::Threads | ( |  | ) |

Returns
  The threads that are in the task (process). The first element (at index `0`) corresponds to the main thread.

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

- snapshot/mac/process_reader.h
- snapshot/mac/process_reader.cc