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:

## 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 ProcessMemory * | Memory ()=0
| Returns a memory reader for 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] | tid | The 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] | tid | The thread ID of the target thread.
  [out] | info | Information 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] | path | The path of the file to read.
  [out] | contents | The 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.

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

- util/linux/ptrace_connection.h