summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/RegisterValue.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-05-18 01:58:14 +0000
committerGreg Clayton <gclayton@apple.com>2011-05-18 01:58:14 +0000
commitcd482e359e464a05b411d634d1172d8701da4b40 (patch)
tree1ac3c39f0f047aaeadbccb4f84de1bf8113f11d6 /lldb/source/Core/RegisterValue.cpp
parent96254a0d538b7cadc5517365911e1e4b4c557231 (diff)
downloadbcm5719-llvm-cd482e359e464a05b411d634d1172d8701da4b40.tar.gz
bcm5719-llvm-cd482e359e464a05b411d634d1172d8701da4b40.zip
Added a way to resolve an load address from a target:
bool Address::SetLoadAddress (lldb::addr_t load_addr, Target *target); Added an == and != operator to RegisterValue. Modified the ThreadPlanTracer to use RegisterValue objects to store the register values when single stepping. Also modified the output to be a bit less wide. Fixed the ABIMacOSX_arm to not overwrite stuff on the stack. Also made the trivial function call be able to set the ARM/Thumbness of the target correctly, and also sets the return value ARM/Thumbness. Fixed the encoding on the arm s0-s31 and d16 - d31 registers when the default register set from a standard GDB server register sets. llvm-svn: 131517
Diffstat (limited to 'lldb/source/Core/RegisterValue.cpp')
-rw-r--r--lldb/source/Core/RegisterValue.cpp72
1 files changed, 71 insertions, 1 deletions
diff --git a/lldb/source/Core/RegisterValue.cpp b/lldb/source/Core/RegisterValue.cpp
index 7e7b3811338..963027154bb 100644
--- a/lldb/source/Core/RegisterValue.cpp
+++ b/lldb/source/Core/RegisterValue.cpp
@@ -73,7 +73,7 @@ RegisterValue::Dump (Stream *s,
data.Dump (s,
0, // Offset in "data"
format, // Format to use when dumping
- reg_info->byte_size, // item_byte_size
+ reg_info->byte_size, // item_byte_size
1, // item_count
UINT32_MAX, // num_per_line
LLDB_INVALID_ADDRESS, // base_addr
@@ -930,3 +930,73 @@ RegisterValue::SetBytes (const void *bytes, size_t length, lldb::ByteOrder byte_
}
}
+
+bool
+RegisterValue::operator == (const RegisterValue &rhs) const
+{
+ if (m_type == rhs.m_type)
+ {
+ switch (m_type)
+ {
+ case eTypeInvalid: return true;
+ case eTypeUInt8: return m_data.uint8 == rhs.m_data.uint8;
+ case eTypeUInt16: return m_data.uint16 == rhs.m_data.uint16;
+ case eTypeUInt32: return m_data.uint32 == rhs.m_data.uint32;
+ case eTypeUInt64: return m_data.uint64 == rhs.m_data.uint64;
+#if defined (ENABLE_128_BIT_SUPPORT)
+ case eTypeUInt128: return m_data.uint128 == rhs.m_data.uint128;
+#endif
+ case eTypeFloat: return m_data.ieee_float == rhs.m_data.ieee_float;
+ case eTypeDouble: return m_data.ieee_double == rhs.m_data.ieee_double;
+ case eTypeLongDouble: return m_data.ieee_long_double == rhs.m_data.ieee_long_double;
+ case eTypeBytes:
+ if (m_data.buffer.length != rhs.m_data.buffer.length)
+ return false;
+ else
+ {
+ uint8_t length = m_data.buffer.length;
+ if (length > kMaxRegisterByteSize)
+ length = kMaxRegisterByteSize;
+ return memcmp (m_data.buffer.bytes, rhs.m_data.buffer.bytes, length) == 0;
+ }
+ break;
+ }
+ }
+ return false;
+}
+
+bool
+RegisterValue::operator != (const RegisterValue &rhs) const
+{
+ if (m_type != rhs.m_type)
+ return true;
+ switch (m_type)
+ {
+ case eTypeInvalid: return false;
+ case eTypeUInt8: return m_data.uint8 != rhs.m_data.uint8;
+ case eTypeUInt16: return m_data.uint16 != rhs.m_data.uint16;
+ case eTypeUInt32: return m_data.uint32 != rhs.m_data.uint32;
+ case eTypeUInt64: return m_data.uint64 != rhs.m_data.uint64;
+#if defined (ENABLE_128_BIT_SUPPORT)
+ case eTypeUInt128: return m_data.uint128 != rhs.m_data.uint128;
+#endif
+ case eTypeFloat: return m_data.ieee_float != rhs.m_data.ieee_float;
+ case eTypeDouble: return m_data.ieee_double != rhs.m_data.ieee_double;
+ case eTypeLongDouble: return m_data.ieee_long_double != rhs.m_data.ieee_long_double;
+ case eTypeBytes:
+ if (m_data.buffer.length != rhs.m_data.buffer.length)
+ {
+ return true;
+ }
+ else
+ {
+ uint8_t length = m_data.buffer.length;
+ if (length > kMaxRegisterByteSize)
+ length = kMaxRegisterByteSize;
+ return memcmp (m_data.buffer.bytes, rhs.m_data.buffer.bytes, length) != 0;
+ }
+ break;
+ }
+ return true;
+}
+
OpenPOWER on IntegriCloud