[Lldb-commits] [lldb] [lldb] Parse GDB remote register vector types (PR #219255)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 1 01:51:20 PDT 2026


================
@@ -629,3 +629,75 @@ TEST(RegisterTypeBuiltinTest, DoesNotSerialize) {
   type.ToXMLElement(strm);
   EXPECT_TRUE(strm.GetString().empty());
 }
+
+TEST(RegisterTypeVectorTest, ConstructionAndXML) {
+  RegisterTypeBuiltin element_type("ieee_single", eEncodingIEEE754,
+                                   eFormatFloat, 4);
+  RegisterTypeVector vector_type("v4f", &element_type, 4);
+
+  EXPECT_EQ(vector_type.GetID(), "v4f");
+  EXPECT_EQ(vector_type.GetElementType(), &element_type);
+  EXPECT_EQ(vector_type.GetCount(), 4u);
+  ASSERT_TRUE(vector_type.GetByteSize());
+  EXPECT_EQ(*vector_type.GetByteSize(), 16u);
+  EXPECT_TRUE(vector_type.IsByteSizeCompatible(16));
+  EXPECT_FALSE(vector_type.IsByteSizeCompatible(12));
----------------
DavidSpickett wrote:

Explain to me how this is byte size compatible with a 12 byte register. Assuming I read that right. Is it that 12 is a multiple of 4, so you're allowed to use 3 out of 4 elements?

I always thought it would be exact matches for size but not for any strong reason, just an assumption.

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


More information about the lldb-commits mailing list