class ReadRegOperation : public Operation
{
public:
- ReadRegOperation(unsigned offset, unsigned size, RegisterValue &value, bool &result)
- : m_offset(offset), m_size(size), m_value(value), m_result(result)
+ ReadRegOperation(lldb::tid_t tid, unsigned offset, unsigned size,
+ RegisterValue &value, bool &result)
+ : m_tid(tid), m_offset(offset), m_size(size),
+ m_value(value), m_result(result)
{ }
void Execute(ProcessMonitor *monitor);
private:
+ lldb::tid_t m_tid;
unsigned m_offset;
unsigned m_size;
RegisterValue &m_value;
void
ReadRegOperation::Execute(ProcessMonitor *monitor)
{
- lldb::pid_t pid = monitor->GetPID();
struct reg regs;
int rc;
- if ((rc = PTRACE(PT_GETREGS, pid, (caddr_t)®s, 0)) < 0) {
+ if ((rc = PTRACE(PT_GETREGS, m_tid, (caddr_t)®s, 0)) < 0) {
m_result = false;
} else {
if (m_size == sizeof(uintptr_t))
class WriteRegOperation : public Operation
{
public:
- WriteRegOperation(unsigned offset, const RegisterValue &value, bool &result)
- : m_offset(offset), m_value(value), m_result(result)
+ WriteRegOperation(lldb::tid_t tid, unsigned offset,
+ const RegisterValue &value, bool &result)
+ : m_tid(tid), m_offset(offset),
+ m_value(value), m_result(result)
{ }
void Execute(ProcessMonitor *monitor);
private:
+ lldb::tid_t m_tid;
unsigned m_offset;
const RegisterValue &m_value;
bool &m_result;
void
WriteRegOperation::Execute(ProcessMonitor *monitor)
{
- lldb::pid_t pid = monitor->GetPID();
struct reg regs;
- if (PTRACE(PT_GETREGS, pid, (caddr_t)®s, 0) < 0) {
+ if (PTRACE(PT_GETREGS, m_tid, (caddr_t)®s, 0) < 0) {
m_result = false;
return;
}
*(uintptr_t *)(((caddr_t)®s) + m_offset) = (uintptr_t)m_value.GetAsUInt64();
- if (PTRACE(PT_SETREGS, pid, (caddr_t)®s, 0) < 0)
+ if (PTRACE(PT_SETREGS, m_tid, (caddr_t)®s, 0) < 0)
m_result = false;
else
m_result = true;
class ReadGPROperation : public Operation
{
public:
- ReadGPROperation(void *buf, bool &result)
- : m_buf(buf), m_result(result)
+ ReadGPROperation(lldb::tid_t tid, void *buf, bool &result)
+ : m_tid(tid), m_buf(buf), m_result(result)
{ }
void Execute(ProcessMonitor *monitor);
private:
+ lldb::tid_t m_tid;
void *m_buf;
bool &m_result;
};
int rc;
errno = 0;
- rc = PTRACE(PT_GETREGS, monitor->GetPID(), (caddr_t)m_buf, 0);
+ rc = PTRACE(PT_GETREGS, m_tid, (caddr_t)m_buf, 0);
if (errno != 0)
m_result = false;
else
class ReadFPROperation : public Operation
{
public:
- ReadFPROperation(void *buf, bool &result)
- : m_buf(buf), m_result(result)
+ ReadFPROperation(lldb::tid_t tid, void *buf, bool &result)
+ : m_tid(tid), m_buf(buf), m_result(result)
{ }
void Execute(ProcessMonitor *monitor);
private:
+ lldb::tid_t m_tid;
void *m_buf;
bool &m_result;
};
void
ReadFPROperation::Execute(ProcessMonitor *monitor)
{
- if (PTRACE(PT_GETFPREGS, monitor->GetPID(), (caddr_t)m_buf, 0) < 0)
+ if (PTRACE(PT_GETFPREGS, m_tid, (caddr_t)m_buf, 0) < 0)
m_result = false;
else
m_result = true;
class WriteGPROperation : public Operation
{
public:
- WriteGPROperation(void *buf, bool &result)
- : m_buf(buf), m_result(result)
+ WriteGPROperation(lldb::tid_t tid, void *buf, bool &result)
+ : m_tid(tid), m_buf(buf), m_result(result)
{ }
void Execute(ProcessMonitor *monitor);
private:
+ lldb::tid_t m_tid;
void *m_buf;
bool &m_result;
};
void
WriteGPROperation::Execute(ProcessMonitor *monitor)
{
- if (PTRACE(PT_SETREGS, monitor->GetPID(), (caddr_t)m_buf, 0) < 0)
+ if (PTRACE(PT_SETREGS, m_tid, (caddr_t)m_buf, 0) < 0)
m_result = false;
else
m_result = true;
class WriteFPROperation : public Operation
{
public:
- WriteFPROperation(void *buf, bool &result)
- : m_buf(buf), m_result(result)
+ WriteFPROperation(lldb::tid_t tid, void *buf, bool &result)
+ : m_tid(tid), m_buf(buf), m_result(result)
{ }
void Execute(ProcessMonitor *monitor);
private:
+ lldb::tid_t m_tid;
void *m_buf;
bool &m_result;
};
void
WriteFPROperation::Execute(ProcessMonitor *monitor)
{
- if (PTRACE(PT_SETFPREGS, monitor->GetPID(), (caddr_t)m_buf, 0) < 0)
+ if (PTRACE(PT_SETFPREGS, m_tid, (caddr_t)m_buf, 0) < 0)
m_result = false;
else
m_result = true;
unsigned size, RegisterValue &value)
{
bool result;
- ReadRegOperation op(offset, size, value, result);
+ ReadRegOperation op(tid, offset, size, value, result);
DoOperation(&op);
return result;
}
const char* reg_name, const RegisterValue &value)
{
bool result;
- WriteRegOperation op(offset, value, result);
+ WriteRegOperation op(tid, offset, value, result);
DoOperation(&op);
return result;
}
ProcessMonitor::ReadGPR(lldb::tid_t tid, void *buf, size_t buf_size)
{
bool result;
- ReadGPROperation op(buf, result);
+ ReadGPROperation op(tid, buf, result);
DoOperation(&op);
return result;
}
ProcessMonitor::ReadFPR(lldb::tid_t tid, void *buf, size_t buf_size)
{
bool result;
- ReadFPROperation op(buf, result);
+ ReadFPROperation op(tid, buf, result);
DoOperation(&op);
return result;
}
ProcessMonitor::WriteGPR(lldb::tid_t tid, void *buf, size_t buf_size)
{
bool result;
- WriteGPROperation op(buf, result);
+ WriteGPROperation op(tid, buf, result);
DoOperation(&op);
return result;
}
ProcessMonitor::WriteFPR(lldb::tid_t tid, void *buf, size_t buf_size)
{
bool result;
- WriteFPROperation op(buf, result);
+ WriteFPROperation op(tid, buf, result);
DoOperation(&op);
return result;
}