Crashpad
|
Manages a direct ptrace
connection to a process.
More...
#include "util/linux/direct_ptrace_connection.h"
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 connected to a 64-bit process. | |
bool | GetThreadInfo (pid_t tid, ThreadInfo *info) override |
Retrieves a ThreadInfo for a target thread. More... | |
bool | ReadFileContents (const base::FilePath &path, std::string *contents) override |
Reads the entire contents of a file. More... | |
ProcessMemory * | Memory () override |
Returns a memory reader for the connected process. More... | |
bool | Threads (std::vector< pid_t > *threads) override |
Determines the thread IDs of the threads in the connected process. More... | |
Manages a direct ptrace
connection to a process.
This class is used when the current process has ptrace
capabilities for the target process.
|
overridevirtual |
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. Implements crashpad::PtraceConnection.
|
overridevirtual |
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. Implements crashpad::PtraceConnection.
bool crashpad::DirectPtraceConnection::Initialize | ( | pid_t | pid | ) |
Initializes this connection for the process whose process ID is pid.
The main thread of the process is automatically attached by this call.
[in] | pid | The process ID of the process to connect to. |
true
on success. false
on failure with a message logged.
|
overridevirtual |
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.
Implements crashpad::PtraceConnection.
|
overridevirtual |
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. Implements crashpad::PtraceConnection.
|
overridevirtual |
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. Implements crashpad::PtraceConnection.