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

Stands-in where real PtraceConnections aren't available. More...

#include "test/linux/fake_ptrace_connection.h"

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

Public Member Functions

bool Initialize (pid_t pid)
 Initializes this connection for the process whose process ID is pid. More...
 
pid_t GetProcessID () override
 Returns the process ID of the connected process.
 
bool Attach (pid_t tid) override
 Adds a new thread to this connection. More...
 
bool Is64Bit () override
 Returns true if the current process is 64-bit.
 
bool GetThreadInfo (pid_t tid, ThreadInfo *info) override
 Does not modify info.
 
bool ReadFileContents (const base::FilePath &path, std::string *contents) override
 Reads the entire contents of a file. More...
 
ProcessMemoryMemory () override
 Attempts to create a ProcessMemory when called, calling ADD_FAILURE() and returning nullptr on failure.
 
bool Threads (std::vector< pid_t > *threads) override
 

Detailed Description

Stands-in where real PtraceConnections aren't available.

This class performs basic EXPECTs that it is used correctly, but does not execute any real ptrace calls or attachments.

Member Function Documentation

◆ Attach()

bool crashpad::test::FakePtraceConnection::Attach ( pid_t  tid)
overridevirtual

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.

Implements crashpad::PtraceConnection.

◆ Initialize()

bool crashpad::test::FakePtraceConnection::Initialize ( pid_t  pid)

Initializes this connection for the process whose process ID is pid.

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

◆ ReadFileContents()

bool crashpad::test::FakePtraceConnection::ReadFileContents ( const base::FilePath &  path,
std::string *  contents 
)
overridevirtual

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.

Implements crashpad::PtraceConnection.

◆ Threads()

bool crashpad::test::FakePtraceConnection::Threads ( std::vector< pid_t > *  threads)
overridevirtual
Todo:
Not yet implemented.

Implements crashpad::PtraceConnection.


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