Crashpad
|
A ProcessSnapshot of a running (or crashed) process running on a Linux system. More...
#include "snapshot/linux/process_snapshot_linux.h"
Public Member Functions | |
bool | Initialize (PtraceConnection *connection) |
Initializes the object. More... | |
pid_t | FindThreadWithStackAddress (VMAddress stack_address) |
Finds the thread whose stack contains stack_address. More... | |
bool | InitializeException (LinuxVMAddress exception_info, pid_t exception_thread_id=-1) |
Initializes the object's exception. More... | |
void | SetReportID (const UUID &report_id) |
Sets the value to be returned by ReportID(). More... | |
void | SetClientID (const UUID &client_id) |
Sets the value to be returned by ClientID(). More... | |
void | AddAnnotation (const std::string &key, const std::string &value) |
Add an annotation to be returned by AnnotationsSimpleMap(). More... | |
void | GetCrashpadOptions (CrashpadInfoClientOptions *options) |
Returns options from CrashpadInfo structures found in modules in the process. More... | |
crashpad::ProcessID | ProcessID () const override |
Returns the snapshot process’ process ID. | |
crashpad::ProcessID | ParentProcessID () const override |
Returns the snapshot process’ parent process’ process ID. | |
void | SnapshotTime (timeval *snapshot_time) const override |
Returns the time that the snapshot was taken in snapshot_time. More... | |
void | ProcessStartTime (timeval *start_time) const override |
Returns the time that the snapshot process was started in start_time. More... | |
void | ProcessCPUTimes (timeval *user_time, timeval *system_time) const override |
Returns the snapshot process’ CPU usage times in user_time and system_time. More... | |
void | ReportID (UUID *report_id) const override |
Returns a UUID identifying the event that the snapshot describes. More... | |
void | ClientID (UUID *client_id) const override |
Returns a UUID identifying the client that the snapshot represents. More... | |
const std::map< std::string, std::string > & | AnnotationsSimpleMap () const override |
Returns key-value string annotations recorded for the process, system, or snapshot producer. More... | |
const SystemSnapshot * | System () const override |
Returns a SystemSnapshot reflecting the characteristics of the system that ran the snapshot process at the time of the snapshot. More... | |
std::vector< const ThreadSnapshot * > | Threads () const override |
Returns ThreadSnapshot objects reflecting the threads (lightweight processes) existing in the snapshot process at the time of the snapshot. More... | |
std::vector< const ModuleSnapshot * > | Modules () const override |
Returns ModuleSnapshot objects reflecting the code modules (binary images) loaded into the snapshot process at the time of the snapshot. More... | |
std::vector< UnloadedModuleSnapshot > | UnloadedModules () const override |
Returns UnloadedModuleSnapshot objects reflecting the code modules the were recorded as unloaded at the time of the snapshot. More... | |
const ExceptionSnapshot * | Exception () const override |
Returns an ExceptionSnapshot reflecting the exception that the snapshot process sustained to trigger the snapshot being taken. More... | |
std::vector< const MemoryMapRegionSnapshot * > | MemoryMap () const override |
Returns MemoryMapRegionSnapshot objects reflecting the regions of the memory map in the snapshot process at the time of the snapshot. More... | |
std::vector< HandleSnapshot > | Handles () const override |
Returns HandleSnapshot objects reflecting the open handles in the snapshot process at the time of the snapshot. More... | |
std::vector< const MemorySnapshot * > | ExtraMemory () const override |
Returns a vector of additional memory blocks that should be included in a minidump. More... | |
const ProcessMemory * | Memory () const override |
Returns a ProcessMemory object that allows accessing the process' memory directly. More... | |
A ProcessSnapshot of a running (or crashed) process running on a Linux system.
|
inline |
Add an annotation to be returned by AnnotationsSimpleMap().
Most process annotations are under the control of the snapshot producer, which may call this method to establish these annotations. On Android Q or later, the process snapshot may add an "abort_message" annotation, which will contain the abort message passed to the android_set_abort_message() function. Contrast this with module annotations, which are under the control of the process being snapshotted.
|
overridevirtual |
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().
Implements crashpad::ProcessSnapshot.
|
overridevirtual |
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.
Implements crashpad::ProcessSnapshot.
|
overridevirtual |
Returns an ExceptionSnapshot reflecting the exception that the snapshot process sustained to trigger the snapshot being taken.
nullptr
. Implements crashpad::ProcessSnapshot.
|
overridevirtual |
Returns a vector of additional memory blocks that should be included in a minidump.
Implements crashpad::ProcessSnapshot.
pid_t crashpad::ProcessSnapshotLinux::FindThreadWithStackAddress | ( | VMAddress | stack_address | ) |
Finds the thread whose stack contains stack_address.
[in] | stack_address | A stack address to search for. |
void crashpad::ProcessSnapshotLinux::GetCrashpadOptions | ( | CrashpadInfoClientOptions * | options | ) |
Returns options from CrashpadInfo structures found in modules in the process.
[out] | options | Options set in CrashpadInfo structures in modules in the process. |
|
overridevirtual |
Returns HandleSnapshot objects reflecting the open handles in the snapshot process at the time of the snapshot.
Implements crashpad::ProcessSnapshot.
bool crashpad::ProcessSnapshotLinux::Initialize | ( | PtraceConnection * | connection | ) |
Initializes the object.
[in] | connection | A connection to the process to snapshot. |
true
if the snapshot could be created, false
otherwise with an appropriate message logged. bool crashpad::ProcessSnapshotLinux::InitializeException | ( | LinuxVMAddress | exception_info, |
pid_t | exception_thread_id = -1 |
||
) |
Initializes the object's exception.
[in] | exception_info | The address of an ExceptionInformation in the target process' address space. |
[in] | exception_thread_id | The thread ID to assocaite the thread with. Optional. If -1, the exception thread will be identified by the ExceptionInformation struct which contains the thread ID in the target process' namespace. |
|
overridevirtual |
Returns a ProcessMemory object that allows accessing the process' memory directly.
Implements crashpad::ProcessSnapshot.
|
overridevirtual |
Returns MemoryMapRegionSnapshot objects reflecting the regions of the memory map in the snapshot process at the time of the snapshot.
Implements crashpad::ProcessSnapshot.
|
overridevirtual |
Returns ModuleSnapshot objects reflecting the code modules (binary images) loaded into the snapshot process at the time of the snapshot.
Implements crashpad::ProcessSnapshot.
|
overridevirtual |
Returns the snapshot process’ CPU usage times in user_time and system_time.
[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. |
Implements crashpad::ProcessSnapshot.
|
overridevirtual |
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.
[out] | start_time | The time that the process was started. |
Implements crashpad::ProcessSnapshot.
|
overridevirtual |
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.
Implements crashpad::ProcessSnapshot.
|
inline |
Sets the value to be returned by ClientID().
The client ID is under the control of the snapshot producer, which may call this method to set the client ID. If this is not done, ClientID() will return an identifier consisting entirely of zeroes.
|
inline |
Sets the value to be returned by ReportID().
The crash report ID is under the control of the snapshot producer, which may call this method to set the report ID. If this is not done, ReportID() will return an identifier consisting entirely of zeroes.
|
overridevirtual |
Returns the time that the snapshot was taken in snapshot_time.
[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. |
Implements crashpad::ProcessSnapshot.
|
overridevirtual |
Returns a SystemSnapshot reflecting the characteristics of the system that ran the snapshot process at the time of the snapshot.
Implements crashpad::ProcessSnapshot.
|
overridevirtual |
Returns ThreadSnapshot objects reflecting the threads (lightweight processes) existing in the snapshot process at the time of the snapshot.
Implements crashpad::ProcessSnapshot.
|
overridevirtual |
Returns UnloadedModuleSnapshot objects reflecting the code modules the were recorded as unloaded at the time of the snapshot.
Implements crashpad::ProcessSnapshot.