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

Provides an architecturally agnostic interface for collecting information with ptrace. More...

#include "util/linux/ptracer.h"

Public Member Functions

 Ptracer (bool is_64_bit)
 Constructs this object with a pre-determined bitness. More...
 
 Ptracer ()
 Constructs this object without a pre-determined bitness. More...
 
bool Initialize (pid_t pid)
 Initializes this object to the bitness of the process whose process ID is pid. More...
 
bool Is64Bit ()
 Return true if this object is configured for 64-bit.
 
bool GetThreadInfo (pid_t tid, ThreadInfo *info)
 Uses ptrace to collect information about the thread with thread ID tid. More...
 

Detailed Description

Provides an architecturally agnostic interface for collecting information with ptrace.

A ptracer is configured for a particular bitness. It is an error to make any calls via this object against a thread whose bitness does not match the bitness this object was initialized with.

Constructor & Destructor Documentation

◆ Ptracer() [1/2]

crashpad::Ptracer::Ptracer ( bool  is_64_bit)
explicit

Constructs this object with a pre-determined bitness.

Parameters
[in]is_64_bittrue if this object is to be configured for 64-bit.

◆ Ptracer() [2/2]

crashpad::Ptracer::Ptracer ( )

Constructs this object without a pre-determined bitness.

Initialize() must be successfully called before making any other calls on this object.

Member Function Documentation

◆ GetThreadInfo()

bool crashpad::Ptracer::GetThreadInfo ( pid_t  tid,
ThreadInfo info 
)

Uses ptrace to collect information about the thread with thread ID tid.

The target thread should be attached before calling this method.

See also
ScopedPtraceAttach
Parameters
[in]tidThe thread ID of the thread to collect information for.
[out]infoA ThreadInfo for the thread.
Returns
true on success. false on failure with a message logged.

◆ Initialize()

bool crashpad::Ptracer::Initialize ( pid_t  pid)

Initializes this object to the bitness of the process whose process ID is pid.

Parameters
[in]pidThe process ID of the process to initialize with.
Returns
true on success. false on failure with a message logged.

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