Crashpad
Public Member Functions | List of all members
crashpad::PtraceConnection Class Referenceabstract

Provides an interface for making ptrace requests against a process and its threads. More...

#include "util/linux/ptrace_connection.h"

Inheritance diagram for crashpad::PtraceConnection:
crashpad::DirectPtraceConnection crashpad::PtraceClient crashpad::test::FakePtraceConnection

Public Member Functions

virtual pid_t GetProcessID ()=0
 Returns the process ID of the connected process.
 
virtual bool Attach (pid_t tid)=0
 Adds a new thread to this connection. More...
 
virtual bool Is64Bit ()=0
 Returns true if connected to a 64-bit process.
 
virtual bool GetThreadInfo (pid_t tid, ThreadInfo *info)=0
 Retrieves a ThreadInfo for a target thread. More...
 
virtual bool ReadFileContents (const base::FilePath &path, std::string *contents)=0
 Reads the entire contents of a file. More...
 
virtual ProcessMemoryMemory ()=0
 Returns a memory reader for the connected process. More...
 
virtual bool Threads (std::vector< pid_t > *threads)=0
 Determines the thread IDs of the threads in the connected process. More...
 

Detailed Description

Provides an interface for making ptrace requests against a process and its threads.

Member Function Documentation

◆ Attach()

virtual bool crashpad::PtraceConnection::Attach ( pid_t  tid)
pure virtual

Adds a new thread to this connection.

Parameters
[in]tidThe thread ID of the thread to attach.
Returns
true on success. false on failure with a message logged.

Implemented in crashpad::PtraceClient, crashpad::DirectPtraceConnection, and crashpad::test::FakePtraceConnection.

◆ GetThreadInfo()

virtual bool crashpad::PtraceConnection::GetThreadInfo ( pid_t  tid,
ThreadInfo info 
)
pure virtual

Retrieves a ThreadInfo for a target thread.

Parameters
[in]tidThe thread ID of the target thread.
[out]infoInformation about the thread.
Returns
true on success. false on failure with a message logged.

Implemented in crashpad::PtraceClient, crashpad::test::FakePtraceConnection, and crashpad::DirectPtraceConnection.

◆ Memory()

virtual ProcessMemory* crashpad::PtraceConnection::Memory ( )
pure virtual

Returns a memory reader for the connected process.

The caller does not take ownership of the reader. The reader is valid for the lifetime of the PtraceConnection that created it.

Implemented in crashpad::test::FakePtraceConnection, crashpad::PtraceClient, and crashpad::DirectPtraceConnection.

◆ ReadFileContents()

virtual bool crashpad::PtraceConnection::ReadFileContents ( const base::FilePath &  path,
std::string *  contents 
)
pure virtual

Reads the entire contents of a file.

Parameters
[in]pathThe path of the file to read.
[out]contentsThe file contents, valid if this method returns true.
Returns
true on success. false on failure with a message logged.

Implemented in crashpad::PtraceClient, crashpad::test::FakePtraceConnection, and crashpad::DirectPtraceConnection.

◆ Threads()

virtual bool crashpad::PtraceConnection::Threads ( std::vector< pid_t > *  threads)
pure virtual

Determines the thread IDs of the threads in the connected process.

Parameters
[out]threadsThe list of thread IDs.
Returns
true on success, false on failure with a message logged. If this method returns false, threads may contain a partial list of thread IDs.

Implemented in crashpad::test::FakePtraceConnection, crashpad::PtraceClient, and crashpad::DirectPtraceConnection.


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