}
bool
-ProcessMonitor::ReadRegisterValue(unsigned offset, unsigned size, RegisterValue &value)
+ProcessMonitor::ReadRegisterValue(lldb::tid_t tid, unsigned offset,
+ unsigned size, RegisterValue &value)
{
bool result;
ReadRegOperation op(offset, size, value, result);
}
bool
-ProcessMonitor::WriteRegisterValue(unsigned offset, const RegisterValue &value)
+ProcessMonitor::WriteRegisterValue(lldb::tid_t tid, unsigned offset,
+ const RegisterValue &value)
{
bool result;
WriteRegOperation op(offset, value, result);
}
bool
-ProcessMonitor::ReadGPR(void *buf)
+ProcessMonitor::ReadGPR(lldb::tid_t tid, void *buf)
{
bool result;
ReadGPROperation op(buf, result);
}
bool
-ProcessMonitor::ReadFPR(void *buf)
+ProcessMonitor::ReadFPR(lldb::tid_t tid, void *buf)
{
bool result;
ReadFPROperation op(buf, result);
}
bool
-ProcessMonitor::WriteGPR(void *buf)
+ProcessMonitor::WriteGPR(lldb::tid_t tid, void *buf)
{
bool result;
WriteGPROperation op(buf, result);
}
bool
-ProcessMonitor::WriteFPR(void *buf)
+ProcessMonitor::WriteFPR(lldb::tid_t tid, void *buf)
{
bool result;
WriteFPROperation op(buf, result);
/// dependent) offset.
///
/// This method is provided for use by RegisterContextFreeBSD derivatives.
+ /// FIXME: The FreeBSD implementation of this function should use tid in order
+ /// to enable support for debugging threaded programs.
bool
- ReadRegisterValue(unsigned offset, unsigned size, lldb_private::RegisterValue &value);
+ ReadRegisterValue(lldb::tid_t tid, unsigned offset,
+ unsigned size, lldb_private::RegisterValue &value);
/// Writes the given value to the register identified by the given
/// (architecture dependent) offset.
///
/// This method is provided for use by RegisterContextFreeBSD derivatives.
+ /// FIXME: The FreeBSD implementation of this function should use tid in order
+ /// to enable support for debugging threaded programs.
bool
- WriteRegisterValue(unsigned offset, const lldb_private::RegisterValue &value);
+ WriteRegisterValue(lldb::tid_t tid, unsigned offset,
+ const lldb_private::RegisterValue &value);
/// Reads all general purpose registers into the specified buffer.
+ /// FIXME: The FreeBSD implementation of this function should use tid in order
+ /// to enable support for debugging threaded programs.
bool
- ReadGPR(void *buf);
+ ReadGPR(lldb::tid_t tid, void *buf);
/// Reads all floating point registers into the specified buffer.
+ /// FIXME: The FreeBSD implementation of this function should use tid in order
+ /// to enable support for debugging threaded programs.
bool
- ReadFPR(void *buf);
+ ReadFPR(lldb::tid_t tid, void *buf);
/// Writes all general purpose registers into the specified buffer.
+ /// FIXME: The FreeBSD implementation of this function should use tid in order
+ /// to enable support for debugging threaded programs.
bool
- WriteGPR(void *buf);
+ WriteGPR(lldb::tid_t tid, void *buf);
/// Writes all floating point registers into the specified buffer.
+ /// FIXME: The FreeBSD implementation of this function should use tid in order
+ /// to enable support for debugging threaded programs.
bool
- WriteFPR(void *buf);
+ WriteFPR(lldb::tid_t tid, void *buf);
/// Writes a siginfo_t structure corresponding to the given thread ID to the
/// memory region pointed to by @p siginfo.
class ReadRegOperation : public Operation
{
public:
- ReadRegOperation(unsigned offset, RegisterValue &value, bool &result)
- : m_offset(offset), m_value(value), m_result(result)
+ ReadRegOperation(lldb::tid_t tid, unsigned offset,
+ 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;
uintptr_t m_offset;
RegisterValue &m_value;
bool &m_result;
void
ReadRegOperation::Execute(ProcessMonitor *monitor)
{
- lldb::pid_t pid = monitor->GetPID();
LogSP log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_REGISTERS));
// Set errno to zero so that we can detect a failed peek.
errno = 0;
- lldb::addr_t data = PTRACE(PTRACE_PEEKUSER, pid, (void*)m_offset, NULL);
+ lldb::addr_t data = PTRACE(PTRACE_PEEKUSER, m_tid, (void*)m_offset, NULL);
if (data == -1UL && errno)
m_result = false;
else
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;
uintptr_t m_offset;
const RegisterValue &m_value;
bool &m_result;
WriteRegOperation::Execute(ProcessMonitor *monitor)
{
void* buf;
- lldb::pid_t pid = monitor->GetPID();
LogSP log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_REGISTERS));
#if __WORDSIZE == 32
if (log)
log->Printf ("ProcessMonitor::%s() reg %s: %p", __FUNCTION__,
POSIXThread::GetRegisterNameFromOffset(m_offset), buf);
- if (PTRACE(PTRACE_POKEUSER, pid, (void*)m_offset, buf))
+ if (PTRACE(PTRACE_POKEUSER, m_tid, (void*)m_offset, buf))
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;
};
void
ReadGPROperation::Execute(ProcessMonitor *monitor)
{
- if (PTRACE(PTRACE_GETREGS, monitor->GetPID(), NULL, m_buf) < 0)
+ if (PTRACE(PTRACE_GETREGS, m_tid, NULL, m_buf) < 0)
m_result = false;
else
m_result = true;
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(PTRACE_GETFPREGS, monitor->GetPID(), NULL, m_buf) < 0)
+ if (PTRACE(PTRACE_GETFPREGS, m_tid, NULL, m_buf) < 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(PTRACE_SETREGS, monitor->GetPID(), NULL, m_buf) < 0)
+ if (PTRACE(PTRACE_SETREGS, m_tid, NULL, m_buf) < 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(PTRACE_SETFPREGS, monitor->GetPID(), NULL, m_buf) < 0)
+ if (PTRACE(PTRACE_SETFPREGS, m_tid, NULL, m_buf) < 0)
m_result = false;
else
m_result = true;
}
bool
-ProcessMonitor::ReadRegisterValue(unsigned offset, unsigned size, RegisterValue &value)
+ProcessMonitor::ReadRegisterValue(lldb::tid_t tid, unsigned offset, unsigned size, RegisterValue &value)
{
bool result;
- ReadRegOperation op(offset, value, result);
+ ReadRegOperation op(tid, offset, value, result);
DoOperation(&op);
return result;
}
bool
-ProcessMonitor::WriteRegisterValue(unsigned offset, const RegisterValue &value)
+ProcessMonitor::WriteRegisterValue(lldb::tid_t tid, unsigned offset, const RegisterValue &value)
{
bool result;
- WriteRegOperation op(offset, value, result);
+ WriteRegOperation op(tid, offset, value, result);
DoOperation(&op);
return result;
}
bool
-ProcessMonitor::ReadGPR(void *buf)
+ProcessMonitor::ReadGPR(lldb::tid_t tid, void *buf)
{
bool result;
- ReadGPROperation op(buf, result);
+ ReadGPROperation op(tid, buf, result);
DoOperation(&op);
return result;
}
bool
-ProcessMonitor::ReadFPR(void *buf)
+ProcessMonitor::ReadFPR(lldb::tid_t tid, void *buf)
{
bool result;
- ReadFPROperation op(buf, result);
+ ReadFPROperation op(tid, buf, result);
DoOperation(&op);
return result;
}
bool
-ProcessMonitor::WriteGPR(void *buf)
+ProcessMonitor::WriteGPR(lldb::tid_t tid, void *buf)
{
bool result;
- WriteGPROperation op(buf, result);
+ WriteGPROperation op(tid, buf, result);
DoOperation(&op);
return result;
}
bool
-ProcessMonitor::WriteFPR(void *buf)
+ProcessMonitor::WriteFPR(lldb::tid_t tid, void *buf)
{
bool result;
- WriteFPROperation op(buf, result);
+ WriteFPROperation op(tid, buf, result);
DoOperation(&op);
return result;
}
}
else {
ProcessMonitor &monitor = GetMonitor();
- return monitor.ReadRegisterValue(GetRegOffset(reg),GetRegSize(reg), value);
+ return monitor.ReadRegisterValue(m_thread.GetID(), GetRegOffset(reg),GetRegSize(reg), value);
}
if (reg_info->encoding == eEncodingVector) {
{
const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
ProcessMonitor &monitor = GetMonitor();
- return monitor.WriteRegisterValue(GetRegOffset(reg), value);
+ return monitor.WriteRegisterValue(m_thread.GetID(), GetRegOffset(reg), value);
}
bool
RegisterContext_x86_64::ReadGPR()
{
ProcessMonitor &monitor = GetMonitor();
- return monitor.ReadGPR(&user.regs);
+ return monitor.ReadGPR(m_thread.GetID(), &user.regs);
}
bool
RegisterContext_x86_64::ReadFPR()
{
ProcessMonitor &monitor = GetMonitor();
- return monitor.ReadFPR(&user.i387);
+ return monitor.ReadFPR(m_thread.GetID(), &user.i387);
}
bool
RegisterContext_x86_64::WriteGPR()
{
ProcessMonitor &monitor = GetMonitor();
- return monitor.WriteGPR(&user.regs);
+ return monitor.WriteGPR(m_thread.GetID(), &user.regs);
}
bool
RegisterContext_x86_64::WriteFPR()
{
ProcessMonitor &monitor = GetMonitor();
- return monitor.WriteFPR(&user.i387);
+ return monitor.WriteFPR(m_thread.GetID(), &user.i387);
}