This revision was automatically updated to reflect the committed changes.
Closed by commit rL283728: [LLDB][MIPS] Fix register read/write for 32 bit big 
endian system (authored by nitesh.jain).

Changed prior to commit:
  https://reviews.llvm.org/D24124?vs=72024&id=74202#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D24124

Files:
  lldb/trunk/source/Core/RegisterValue.cpp
  lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp


Index: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp
@@ -169,7 +169,7 @@
 
   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__,
Index: lldb/trunk/source/Core/RegisterValue.cpp
===================================================================
--- lldb/trunk/source/Core/RegisterValue.cpp
+++ lldb/trunk/source/Core/RegisterValue.cpp
@@ -633,8 +633,11 @@
     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;
     }


Index: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp
@@ -169,7 +169,7 @@
 
   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__,
Index: lldb/trunk/source/Core/RegisterValue.cpp
===================================================================
--- lldb/trunk/source/Core/RegisterValue.cpp
+++ lldb/trunk/source/Core/RegisterValue.cpp
@@ -633,8 +633,11 @@
     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;
     }
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to