[Lldb-commits] [lldb] [LLDB] Expose and display GDB remote register union values (PR #224147)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 12 06:46:53 PDT 2026


================
@@ -248,11 +347,14 @@ RegisterTypeBuilderClang::GetRegisterType(const RegisterInfo &reg_info) {
         llvm::dyn_cast<RegisterTypeEnum>(reg_info.register_type),
         reg_info.byte_size, type_system);
   case RegisterType::eRegisterTypeKindVector:
-    return BuildVectorType(
-        llvm::cast<RegisterTypeVector>(reg_info.register_type),
-        reg_info.byte_size, type_system);
-  case RegisterType::eRegisterTypeKindUnion:
-    return {};
+    return BuildType(reg_info.register_type, reg_info.byte_size, type_system);
+  case RegisterType::eRegisterTypeKindUnion: {
+    std::optional<uint32_t> byte_size =
+        GetExpectedByteSize(reg_info.register_type, type_system);
+    if (!byte_size || *byte_size > reg_info.byte_size)
+      return {};
----------------
DavidSpickett wrote:

Why not sink this into BuildUnionType? So this dispatcher is not more complicated.

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


More information about the lldb-commits mailing list