Matej =?utf-8?q?Košík?= <[email protected]>,
Matej =?utf-8?q?Košík?= <[email protected]>,
Matej =?utf-8?q?Košík?= <[email protected]>,
Matej =?utf-8?q?Košík?= <[email protected]>,
Matej =?utf-8?q?Košík?= <[email protected]>,
Matej =?utf-8?q?Košík?= <[email protected]>,
Matej =?utf-8?q?Košík?= <[email protected]>,
Matej =?utf-8?q?Košík?= <[email protected]>,
Matej =?utf-8?q?Košík?= <[email protected]>,
Matej =?utf-8?q?Košík?= <[email protected]>,
Matej =?utf-8?q?Košík?= <[email protected]>,
Matej =?utf-8?q?Košík?= <[email protected]>,
Matej =?utf-8?q?Košík?= <[email protected]>,
Matej =?utf-8?q?Košík?= <[email protected]>,
Matej =?utf-8?q?Košík?= <[email protected]>,
Matej =?utf-8?q?Košík?= <[email protected]>,
Matej =?utf-8?q?Košík?= <[email protected]>,
Matej =?utf-8?q?Košík?= <[email protected]>,
Matej =?utf-8?q?Košík?= <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>


================
@@ -206,7 +206,30 @@ Status RegisterValue::SetValueFromData(const RegisterInfo 
&reg_info,
         int128.x[0] = data2;
         int128.x[1] = data1;
       }
-      SetUInt128(llvm::APInt(128, int128.x));
+      SetUIntN(llvm::APInt(128, int128.x));
+    } else {
+      std::vector<uint8_t> bytes(src_len, 0);
+      for (size_t i = 0; i < src_len; i++)
+        bytes[i] = src.GetU8(&src_offset);
+
+      if (src.GetByteOrder() == eByteOrderBig)
+        // Transform the big-endian input to little-endian
+        // because that is what the "llvm::LoadIntFromMemory" function
+        // we call below expects.
+        std::reverse(bytes.begin(), bytes.end());
+
+      if (llvm::sys::IsBigEndianHost) {
+        // If LLDB runs on a big-endian architecture,
+        // make sure that the input data can be read in
+        // 64-bit chunks because that is what
+        // the "llvm::LoadIntFromMemory" function will do.
----------------
DavidSpickett wrote:

Can you explain what happens on little endian that means we don't need this 
rounding up?

Is it because the least significant bytes come first and so if the last uint64 
is truncated, it's fine as long as we didn't need all of its bits?

https://github.com/llvm/llvm-project/pull/166363
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to