[Lldb-commits] [PATCH] D17167: Fix bug with register values byte order in expression evaluation

Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 26 09:45:38 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL262041: Fix bug with register values byte order in expression evaluation. (authored by aidandodds).

Changed prior to commit:
  http://reviews.llvm.org/D17167?vs=48486&id=49204#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D17167

Files:
  lldb/trunk/source/Expression/Materializer.cpp

Index: lldb/trunk/source/Expression/Materializer.cpp
===================================================================
--- lldb/trunk/source/Expression/Materializer.cpp
+++ lldb/trunk/source/Expression/Materializer.cpp
@@ -26,6 +26,7 @@
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Utility/LLDBAssert.h"
 
 using namespace lldb_private;
 
@@ -1275,9 +1276,14 @@
         m_register_contents.reset(new DataBufferHeap(register_data.GetDataStart(), register_data.GetByteSize()));
         
         Error write_error;
-        
-        map.WriteMemory(load_addr, register_data.GetDataStart(), register_data.GetByteSize(), write_error);
-        
+
+        Scalar scalar;
+        reg_value.GetScalarValue(scalar);
+
+        lldbassert(scalar.GetByteSize() == register_data.GetByteSize());
+
+        map.WriteScalarToMemory(load_addr, scalar, scalar.GetByteSize(), write_error);
+
         if (!write_error.Success())
         {
             err.SetErrorStringWithFormat("couldn't write the contents of register %s: %s", m_register_info.name, write_error.AsCString());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17167.49204.patch
Type: text/x-patch
Size: 1145 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160226/dce5ef10/attachment.bin>


More information about the lldb-commits mailing list