Accesses information about another process, identified by a process ID.
More...
#include "snapshot/mac/process_reader.h"
|
struct | Module |
| Contains information about a module loaded into a process. More...
|
|
struct | Thread |
| Contains information about a thread that belongs to a process. More...
|
|
|
bool | Initialize (pid_t pid) |
| Initializes this object. More...
|
|
bool | Is64Bit () const |
| Return true if the target task is a 64-bit process.
|
|
pid_t | ProcessID () const |
| Return the target process' process ID.
|
|
pid_t | ParentProcessID () const |
| Return the target process' parent process ID.
|
|
ProcessMemory * | Memory () |
| Return a memory reader for the target process.
|
|
MemoryMap * | GetMemoryMap () |
| Return a memory map of the target process.
|
|
bool | 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 std::vector< Thread > & | Threads () |
| Return a vector of threads that are in the task process. If the main thread is able to be identified and traced, it will be placed at index 0 .
|
|
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 () |
|
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...
|
|
Accesses information about another process, identified by a process ID.
Accesses information about another process, identified by a Mach task.
◆ CPUTimes() [1/2]
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.
◆ CPUTimes() [2/2]
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.
◆ DyldAllImageInfo()
mach_vm_address_t crashpad::ProcessReader::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_size | The 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() [1/2]
bool crashpad::ProcessReader::Initialize |
( |
pid_t |
pid | ) |
|
Initializes this object.
This method must be successfully called before calling any other method in this class.
- Parameters
-
[in] | pid | The process ID of the target process. |
- Returns
true
on success. false
on failure with a message logged.
◆ Initialize() [2/2]
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()
- Returns
- Accesses the memory of the target task.
◆ 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() [1/2]
void crashpad::ProcessReader::StartTime |
( |
timeval * |
start_time | ) |
const |
Determines the target process’ start time.
- Parameters
-
[out] | start_time | The time that the process started. |
- Returns
true
on success with start_time set. Otherwise false
with a message logged.
◆ StartTime() [2/2]
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<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/linux/process_reader.h
- snapshot/linux/process_reader.cc