[Lldb-commits] [lldb] [lldb] Support arbitrary precision integer registers (PR #166363)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 5 07:01:51 PST 2025


Matej =?utf-8?q?Košík?= <matej.kosik at codasip.com>,
Matej =?utf-8?q?Košík?= <matej.kosik at codasip.com>,
Matej =?utf-8?q?Košík?= <matej.kosik at codasip.com>,
Matej =?utf-8?q?Košík?= <matej.kosik at codasip.com>,
Matej =?utf-8?q?Košík?= <matej.kosik at codasip.com>,
Matej =?utf-8?q?Košík?= <matej.kosik at codasip.com>,
Matej =?utf-8?q?Košík?= <matej.kosik at codasip.com>,
Matej =?utf-8?q?Košík?= <m4tej.kosik at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/166363 at github.com>


================
@@ -207,6 +207,18 @@ Status RegisterValue::SetValueFromData(const RegisterInfo &reg_info,
         int128.x[1] = data1;
       }
       SetUInt128(llvm::APInt(128, 2, 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)
+        std::reverse(bytes.begin(), bytes.end());
+      // The number of 64-bit wide words that are stored in "src".
----------------
DavidSpickett wrote:

I see what the code is doing but this is a little misleading, I think. Is src actually stored as 64-bit words or is it stored as bytes and you want to round up the storage to a multiple of 8 bytes because that's what APInt needs?

https://github.com/llvm/llvm-project/pull/166363


More information about the lldb-commits mailing list