Provides an interface for making ptrace
requests against a process and its threads.
More...
#include "util/linux/ptrace_connection.h"
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. | |
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. | |
virtual bool | ReadFileContents (const base::FilePath &path, std::string *contents)=0 |
Reads the entire contents of a file. | |
virtual ProcessMemoryLinux * | Memory ()=0 |
Returns a memory reader for the connected process. | |
virtual bool | Threads (std::vector< pid_t > *threads)=0 |
Determines the thread IDs of the threads in the connected process. | |
virtual ssize_t | ReadUpTo (VMAddress address, size_t size, void *buffer)=0 |
Copies memory from the connected process into a caller-provided buffer in the current process, up to a maximum number of bytes. | |
Provides an interface for making ptrace
requests against a process and its threads.
|
pure virtual |
Adds a new thread to this connection.
[in] | tid | The thread ID of the thread to attach. |
true
on success. false
on failure with a message logged. Implemented in crashpad::DirectPtraceConnection, crashpad::PtraceClient, and crashpad::test::FakePtraceConnection.
|
pure virtual |
Returns the process ID of the connected process.
Implemented in crashpad::DirectPtraceConnection, crashpad::PtraceClient, and crashpad::test::FakePtraceConnection.
|
pure virtual |
Retrieves a ThreadInfo for a target thread.
[in] | tid | The thread ID of the target thread. |
[out] | info | Information about the thread. |
true
on success. false
on failure with a message logged. Implemented in crashpad::DirectPtraceConnection, crashpad::PtraceClient, and crashpad::test::FakePtraceConnection.
|
pure virtual |
Returns true
if connected to a 64-bit process.
Implemented in crashpad::DirectPtraceConnection, crashpad::PtraceClient, and crashpad::test::FakePtraceConnection.
|
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::DirectPtraceConnection, crashpad::PtraceClient, and crashpad::test::FakePtraceConnection.
|
pure virtual |
Reads the entire contents of a file.
[in] | path | The path of the file to read. |
[out] | contents | The file contents, valid if this method returns true . |
true
on success. false
on failure with a message logged. Implemented in crashpad::DirectPtraceConnection, crashpad::PtraceClient, and crashpad::test::FakePtraceConnection.
|
pure virtual |
Copies memory from the connected process into a caller-provided buffer in the current process, up to a maximum number of bytes.
[in] | address | The address, in the connected process' address space, of the memory region to copy. |
[in] | size | The maximum size, in bytes, of the memory region to copy. buffer must be at least this size. |
[out] | buffer | The buffer into which the contents of the other process' memory will be copied. |
Implemented in crashpad::DirectPtraceConnection, crashpad::PtraceClient, and crashpad::test::FakePtraceConnection.
|
pure virtual |
Determines the thread IDs of the threads in the connected process.
[out] | threads | The list of thread IDs. |
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::DirectPtraceConnection, crashpad::PtraceClient, and crashpad::test::FakePtraceConnection.