Allow reading registers by thread ID in ProcessMonitor (Linux implementation)
- make FreeBSD ProcessMonitor API thread-ready
Patch by Matt Kopec!
llvm-svn: 170445
diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
index 177153a..e37a660 100644
--- a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
@@ -1410,7 +1410,8 @@
}
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);
@@ -1419,7 +1420,8 @@
}
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);
@@ -1428,7 +1430,7 @@
}
bool
-ProcessMonitor::ReadGPR(void *buf)
+ProcessMonitor::ReadGPR(lldb::tid_t tid, void *buf)
{
bool result;
ReadGPROperation op(buf, result);
@@ -1437,7 +1439,7 @@
}
bool
-ProcessMonitor::ReadFPR(void *buf)
+ProcessMonitor::ReadFPR(lldb::tid_t tid, void *buf)
{
bool result;
ReadFPROperation op(buf, result);
@@ -1446,7 +1448,7 @@
}
bool
-ProcessMonitor::WriteGPR(void *buf)
+ProcessMonitor::WriteGPR(lldb::tid_t tid, void *buf)
{
bool result;
WriteGPROperation op(buf, result);
@@ -1455,7 +1457,7 @@
}
bool
-ProcessMonitor::WriteFPR(void *buf)
+ProcessMonitor::WriteFPR(lldb::tid_t tid, void *buf)
{
bool result;
WriteFPROperation op(buf, result);
diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.h b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.h
index 5530ca3..4193c77 100644
--- a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.h
+++ b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.h
@@ -103,31 +103,45 @@
/// 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.