[Lldb-commits] [lldb] r283728 - [LLDB][MIPS] Fix register read/write for 32 bit big endian system
Nitesh Jain via lldb-commits
lldb-commits at lists.llvm.org
Mon Oct 10 02:02:42 PDT 2016
Author: nitesh.jain
Date: Mon Oct 10 04:02:41 2016
New Revision: 283728
URL: http://llvm.org/viewvc/llvm-project?rev=283728&view=rev
Log:
[LLDB][MIPS] Fix register read/write for 32 bit big endian system
Reviewers: clayborg, labath
Subscribers: jaydeep, bhushan, mohit.bhakkad, slthakur, llvm-commits
Differential Revision: https://reviews.llvm.org/D24124
Modified:
lldb/trunk/source/Core/RegisterValue.cpp
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp
Modified: lldb/trunk/source/Core/RegisterValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/RegisterValue.cpp?rev=283728&r1=283727&r2=283728&view=diff
==============================================================================
--- lldb/trunk/source/Core/RegisterValue.cpp (original)
+++ lldb/trunk/source/Core/RegisterValue.cpp Mon Oct 10 04:02:41 2016
@@ -633,8 +633,11 @@ uint64_t RegisterValue::GetAsUInt64(uint
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;
}
Modified: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp?rev=283728&r1=283727&r2=283728&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp Mon Oct 10 04:02:41 2016
@@ -169,7 +169,7 @@ Error NativeRegisterContextLinux::DoRead
if (error.Success())
// First cast to an unsigned of the same size to avoid sign extension.
- value.SetUInt64(static_cast<unsigned long>(data));
+ value.SetUInt(static_cast<unsigned long>(data), size);
if (log)
log->Printf("NativeRegisterContextLinux::%s() reg %s: 0x%lx", __FUNCTION__,
More information about the lldb-commits
mailing list