summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-05-13 21:29:50 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-05-13 21:29:50 +0000
commit13e8e1c37d38a87da2d17bd2ed418da9004ae2b3 (patch)
tree4af90b7be7d96cfec0cf042e58356cb4d8b7fe87 /lldb/source/Plugins/Process
parentcaf8ffd8e3fb49fd5a5a8a5c907d258277c2b69d (diff)
downloadbcm5719-llvm-13e8e1c37d38a87da2d17bd2ed418da9004ae2b3.tar.gz
bcm5719-llvm-13e8e1c37d38a87da2d17bd2ed418da9004ae2b3.zip
This patch add a "fake" attach waiting for a real implementation and
solve the build break due to the lack of this method. It also propose a solution to the API changes in RegisterContext. I upgraded also the the python version in the makefile. My linux installation has python2.7 and AFAIK also the latest ubuntu has this version of python so maybe is worth upgrading. Patch by Marco Minutoli <mminutoli@gmail.com> [Note: I had to hand merge in the diffs since patch thinks it is a corrupt patch.] llvm-svn: 131313
Diffstat (limited to 'lldb/source/Plugins/Process')
-rw-r--r--lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp15
-rw-r--r--lldb/source/Plugins/Process/Linux/ProcessMonitor.h4
-rw-r--r--lldb/source/Plugins/Process/Linux/RegisterContextLinux_i386.cpp25
-rw-r--r--lldb/source/Plugins/Process/Linux/RegisterContextLinux_i386.h12
-rw-r--r--lldb/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp5
-rw-r--r--lldb/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.h12
6 files changed, 63 insertions, 10 deletions
diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
index 48a57a8b010..f482c014ee1 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
+++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
@@ -20,6 +20,7 @@
// C++ Includes
// Other libraries and framework includes
#include "lldb/Core/Error.h"
+#include "lldb/Core/RegisterValue.h"
#include "lldb/Core/Scalar.h"
#include "lldb/Host/Host.h"
#include "lldb/Target/Thread.h"
@@ -221,7 +222,7 @@ WriteOperation::Execute(ProcessMonitor *monitor)
class ReadRegOperation : public Operation
{
public:
- ReadRegOperation(unsigned offset, Scalar &value, bool &result)
+ ReadRegOperation(unsigned offset, RegisterValue &value, bool &result)
: m_offset(offset), m_value(value), m_result(result)
{ }
@@ -229,7 +230,7 @@ public:
private:
unsigned m_offset;
- Scalar &m_value;
+ RegisterValue &m_value;
bool &m_result;
};
@@ -257,7 +258,7 @@ ReadRegOperation::Execute(ProcessMonitor *monitor)
class WriteRegOperation : public Operation
{
public:
- WriteRegOperation(unsigned offset, const Scalar &value, bool &result)
+ WriteRegOperation(unsigned offset, const RegisterValue &value, bool &result)
: m_offset(offset), m_value(value), m_result(result)
{ }
@@ -265,7 +266,7 @@ public:
private:
unsigned m_offset;
- const Scalar &m_value;
+ const RegisterValue &m_value;
bool &m_result;
};
@@ -274,7 +275,7 @@ WriteRegOperation::Execute(ProcessMonitor *monitor)
{
lldb::pid_t pid = monitor->GetPID();
- if (ptrace(PTRACE_POKEUSER, pid, m_offset, m_value.ULong()))
+ if (ptrace(PTRACE_POKEUSER, pid, m_offset, m_value.GetAsUInt64()))
m_result = false;
else
m_result = true;
@@ -1097,7 +1098,7 @@ ProcessMonitor::WriteMemory(lldb::addr_t vm_addr, const void *buf, size_t size,
}
bool
-ProcessMonitor::ReadRegisterValue(unsigned offset, Scalar &value)
+ProcessMonitor::ReadRegisterValue(unsigned offset, RegisterValue &value)
{
bool result;
ReadRegOperation op(offset, value, result);
@@ -1106,7 +1107,7 @@ ProcessMonitor::ReadRegisterValue(unsigned offset, Scalar &value)
}
bool
-ProcessMonitor::WriteRegisterValue(unsigned offset, const Scalar &value)
+ProcessMonitor::WriteRegisterValue(unsigned offset, const RegisterValue &value)
{
bool result;
WriteRegOperation op(offset, value, result);
diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.h b/lldb/source/Plugins/Process/Linux/ProcessMonitor.h
index 1bfdb862d88..0f2f61c8d58 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.h
+++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.h
@@ -100,14 +100,14 @@ public:
///
/// This method is provided for use by RegisterContextLinux derivatives.
bool
- ReadRegisterValue(unsigned offset, lldb_private::Scalar &value);
+ ReadRegisterValue(unsigned offset, 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 RegisterContextLinux derivatives.
bool
- WriteRegisterValue(unsigned offset, const lldb_private::Scalar &value);
+ WriteRegisterValue(unsigned offset, const lldb_private::RegisterValue &value);
/// Reads all general purpose registers into the specified buffer.
bool
diff --git a/lldb/source/Plugins/Process/Linux/RegisterContextLinux_i386.cpp b/lldb/source/Plugins/Process/Linux/RegisterContextLinux_i386.cpp
index 6bee0c90906..0a8ec5a1c0d 100644
--- a/lldb/source/Plugins/Process/Linux/RegisterContextLinux_i386.cpp
+++ b/lldb/source/Plugins/Process/Linux/RegisterContextLinux_i386.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterContextLinux_i386.cpp ----------------------------*- C++ -*-===//
+//===-- RegisterContextLinux_i386.cpp ---------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -411,6 +411,17 @@ RegisterContextLinux_i386::GetRegisterSet(uint32_t set)
}
bool
+RegisterContextLinux_i386::ReadRegister(const RegisterInfo *reg_info,
+ RegisterValue &value)
+{
+ const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
+ ProcessMonitor &monitor = GetMonitor();
+ return monitor.ReadRegisterValue(GetRegOffset(reg), value);
+}
+
+#if 0
+
+bool
RegisterContextLinux_i386::ReadRegisterValue(uint32_t reg,
Scalar &value)
{
@@ -441,12 +452,16 @@ RegisterContextLinux_i386::ReadRegisterBytes(uint32_t reg,
return status;
}
+#endif
+
bool
RegisterContextLinux_i386::ReadAllRegisterValues(DataBufferSP &data_sp)
{
return false;
}
+#if 0
+
bool
RegisterContextLinux_i386::WriteRegisterValue(uint32_t reg,
const Scalar &value)
@@ -463,6 +478,14 @@ RegisterContextLinux_i386::WriteRegisterBytes(uint32_t reg,
return false;
}
+#endif
+
+bool RegisterContextLinux_i386::WriteRegister(const RegisterInfo *reg_info,
+ const RegisterValue &value)
+{
+ return false;
+}
+
bool
RegisterContextLinux_i386::WriteAllRegisterValues(const DataBufferSP &data)
{
diff --git a/lldb/source/Plugins/Process/Linux/RegisterContextLinux_i386.h b/lldb/source/Plugins/Process/Linux/RegisterContextLinux_i386.h
index 890fd88240e..ef3a76b8e0a 100644
--- a/lldb/source/Plugins/Process/Linux/RegisterContextLinux_i386.h
+++ b/lldb/source/Plugins/Process/Linux/RegisterContextLinux_i386.h
@@ -42,21 +42,33 @@ public:
const lldb_private::RegisterSet *
GetRegisterSet(uint32_t set);
+#if 0
bool
ReadRegisterValue(uint32_t reg, lldb_private::Scalar &value);
bool
ReadRegisterBytes(uint32_t reg, lldb_private::DataExtractor &data);
+#endif
+
+ virtual bool
+ ReadRegister(const lldb_private::RegisterInfo *reg_info,
+ lldb_private::RegisterValue &value);
bool
ReadAllRegisterValues(lldb::DataBufferSP &data_sp);
+#if 0
bool
WriteRegisterValue(uint32_t reg, const lldb_private::Scalar &value);
bool
WriteRegisterBytes(uint32_t reg, lldb_private::DataExtractor &data,
uint32_t data_offset = 0);
+#endif
+
+ virtual bool
+ WriteRegister(const lldb_private::RegisterInfo *reg_info,
+ const lldb_private::RegisterValue &value);
bool
WriteAllRegisterValues(const lldb::DataBufferSP &data_sp);
diff --git a/lldb/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp b/lldb/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp
index 27ca5b8690e..012690ffac4 100644
--- a/lldb/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.cpp
@@ -475,6 +475,7 @@ RegisterContextLinux_x86_64::GetRegisterSet(uint32_t set)
return NULL;
}
+#if 0
bool
RegisterContextLinux_x86_64::ReadRegisterValue(uint32_t reg,
Scalar &value)
@@ -506,12 +507,15 @@ RegisterContextLinux_x86_64::ReadRegisterBytes(uint32_t reg,
return status;
}
+#endif
+
bool
RegisterContextLinux_x86_64::ReadAllRegisterValues(DataBufferSP &data_sp)
{
return false;
}
+#if 0
bool
RegisterContextLinux_x86_64::WriteRegisterValue(uint32_t reg,
const Scalar &value)
@@ -527,6 +531,7 @@ RegisterContextLinux_x86_64::WriteRegisterBytes(uint32_t reg,
{
return false;
}
+#endif
bool
RegisterContextLinux_x86_64::WriteAllRegisterValues(const DataBufferSP &data)
diff --git a/lldb/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.h b/lldb/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.h
index 48540b4e60a..2d210c61541 100644
--- a/lldb/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.h
+++ b/lldb/source/Plugins/Process/Linux/RegisterContextLinux_x86_64.h
@@ -41,21 +41,33 @@ public:
const lldb_private::RegisterSet *
GetRegisterSet(uint32_t set);
+#if 0
bool
ReadRegisterValue(uint32_t reg, lldb_private::Scalar &value);
bool
ReadRegisterBytes(uint32_t reg, lldb_private::DataExtractor &data);
+#endif
+
+ virtual bool
+ ReadRegister(const lldb_private::RegisterInfo *reg_info,
+ lldb_private::RegisterValue &value);
bool
ReadAllRegisterValues(lldb::DataBufferSP &data_sp);
+#if 0
bool
WriteRegisterValue(uint32_t reg, const lldb_private::Scalar &value);
bool
WriteRegisterBytes(uint32_t reg, lldb_private::DataExtractor &data,
uint32_t data_offset = 0);
+#endif
+
+ virtual bool
+ WriteRegister(const lldb_private::RegisterInfo *reg_info,
+ const lldb_private::RegisterValue &value);
bool
WriteAllRegisterValues(const lldb::DataBufferSP &data_sp);
OpenPOWER on IntegriCloud