aboutsummaryrefslogtreecommitdiff
path: root/source/Core/RegisterValue.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-11-25 19:15:31 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-11-25 19:15:31 +0000
commit4ee8c119c71a06dcad1e0fecc8c675e480e59337 (patch)
treed0b329e28aa1f4a0fc00c9763bcb3b2f5bf505ea /source/Core/RegisterValue.cpp
parent3b6b9a026ed26abe3a3f1470da00ae1f478c4aca (diff)
downloadsrc-vendor/lldb/lldb-release_39-r288513.tar.gz
src-vendor/lldb/lldb-release_39-r288513.zip
Diffstat (limited to 'source/Core/RegisterValue.cpp')
-rw-r--r--source/Core/RegisterValue.cpp57
1 files changed, 30 insertions, 27 deletions
diff --git a/source/Core/RegisterValue.cpp b/source/Core/RegisterValue.cpp
index d9085d7f0bae..d739dd6b5902 100644
--- a/source/Core/RegisterValue.cpp
+++ b/source/Core/RegisterValue.cpp
@@ -652,34 +652,37 @@ RegisterValue::GetAsUInt32 (uint32_t fail_value, bool *success_ptr) const
uint64_t
RegisterValue::GetAsUInt64 (uint64_t fail_value, bool *success_ptr) const
{
- if (success_ptr)
- *success_ptr = true;
- switch (m_type)
- {
- default: break;
- case eTypeUInt8:
- case eTypeUInt16:
- case eTypeUInt32:
- case eTypeUInt64:
- case eTypeFloat:
- case eTypeDouble:
- case eTypeLongDouble: return m_scalar.ULongLong(fail_value);
- case eTypeBytes:
- {
- switch (buffer.length)
- {
- default: break;
- case 1:
- case 2:
- case 4:
- case 8: return *(const uint64_t *)buffer.bytes;
- }
- }
- break;
+ if (success_ptr)
+ *success_ptr = true;
+ switch (m_type) {
+ default:
+ break;
+ case eTypeUInt8:
+ case eTypeUInt16:
+ case eTypeUInt32:
+ case eTypeUInt64:
+ case eTypeFloat:
+ case eTypeDouble:
+ case eTypeLongDouble:
+ return m_scalar.ULongLong(fail_value);
+ case eTypeBytes: {
+ switch (buffer.length) {
+ default:
+ break;
+ case 1:
+ return *(const uint8_t *)buffer.bytes;
+ case 2:
+ return *(const uint16_t *)buffer.bytes;
+ case 4:
+ return *(const uint32_t *)buffer.bytes;
+ case 8:
+ return *(const uint64_t *)buffer.bytes;
}
- if (success_ptr)
- *success_ptr = false;
- return fail_value;
+ } break;
+ }
+ if (success_ptr)
+ *success_ptr = false;
+ return fail_value;
}
llvm::APInt