Crashpad
Classes | Public Member Functions | List of all members
crashpad::ProcessReaderMac Class Reference

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

#include "snapshot/mac/process_reader_mac.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...
 
const ProcessMemoryMacMemory () const
 
const std::vector< Thread > & Threads ()
 
const std::vector< Module > & Modules ()
 
mach_vm_address_t DyldAllImageInfo (mach_vm_size_t *all_image_info_size)
 Determines the location of the dyld_all_image_infos structure in the process’ address space. More...
 

Detailed Description

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

Member Function Documentation

◆ CPUTimes()

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

Determines the target process’ execution time.

Parameters
[out]user_timeThe amount of time the process has executed code in user mode.
[out]system_timeThe 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.

◆ DyldAllImageInfo()

mach_vm_address_t crashpad::ProcessReaderMac::DyldAllImageInfo ( mach_vm_size_t *  all_image_info_size)

Determines the location of the dyld_all_image_infos structure in the process’ address space.

This function is an internal implementation detail of Modules(), and should not normally be used directly. It is exposed solely for use by test code.

Parameters
[out]all_image_info_sizeThe size of the dyld_all_image_infos structure. Optional, may be nullptr if not required.
Returns
The address of the dyld_all_image_infos structure in the process’ address space, with all_image_info_size set appropriately. On failure, returns 0 with a message logged.

◆ Initialize()

bool crashpad::ProcessReaderMac::Initialize ( task_t  task)

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

Parameters
[in]taskA 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::ProcessReaderMac::Is64Bit ( ) const
inline
Returns
true if the target task is a 64-bit process.

◆ Memory()

const ProcessMemoryMac* crashpad::ProcessReaderMac::Memory ( ) const
inline
Returns
Accesses the memory of the target task.

◆ Modules()

const std::vector< ProcessReaderMac::Module > & crashpad::ProcessReaderMac::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::ProcessReaderMac::ParentProcessID ( ) const
inline
Returns
The target task’s parent process ID.

◆ ProcessID()

pid_t crashpad::ProcessReaderMac::ProcessID ( ) const
inline
Returns
The target task’s process ID.

◆ StartTime()

void crashpad::ProcessReaderMac::StartTime ( timeval *  start_time) const

Determines the target process’ start time.

Parameters
[out]start_timeThe time that the process started.

◆ Threads()

const std::vector< ProcessReaderMac::Thread > & crashpad::ProcessReaderMac::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: