#include "util/linux/ptrace_client.h"
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <iterator>
#include <string>
#include "base/check_op.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "util/file/file_io.h"
#include "util/linux/ptrace_broker.h"
#include "util/process/process_memory_linux.h"
namespace crashpad {
namespace {
bool ReceiveAndLogError(int sock, const std::string& operation) { … }
bool ReceiveAndLogReadError(int sock, const std::string& operation) { … }
bool AttachImpl(int sock, pid_t tid) { … }
struct Dirent64 { … };
void ReadDentsAsThreadIDs(char* buffer,
size_t size,
std::vector<pid_t>* threads) { … }
}
PtraceClient::PtraceClient()
: … { … }
PtraceClient::~PtraceClient() { … }
bool PtraceClient::Initialize(int sock, pid_t pid) { … }
pid_t PtraceClient::GetProcessID() { … }
bool PtraceClient::Attach(pid_t tid) { … }
bool PtraceClient::Is64Bit() { … }
bool PtraceClient::GetThreadInfo(pid_t tid, ThreadInfo* info) { … }
bool PtraceClient::ReadFileContents(const base::FilePath& path,
std::string* contents) { … }
ProcessMemoryLinux* PtraceClient::Memory() { … }
bool PtraceClient::Threads(std::vector<pid_t>* threads) { … }
ssize_t PtraceClient::ReadUpTo(VMAddress address, size_t size, void* buffer) { … }
bool PtraceClient::SendFilePath(const char* path, size_t length) { … }
}