[Lldb-commits] [llvm] [lldb] Fix size in bytes of type DIEs when size in bits is not a multiple of 8 (PR #69741)

Augusto Noronha via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 10 10:32:29 PST 2023


================
@@ -2210,9 +2216,16 @@ bool DWARFASTParserClang::CompleteRecordType(const DWARFDIE &die,
       !layout_info.vbase_offsets.empty()) {
     if (type)
       layout_info.bit_size = type->GetByteSize(nullptr).value_or(0) * 8;
-    if (layout_info.bit_size == 0)
-      layout_info.bit_size =
-          die.GetAttributeValueAsUnsigned(DW_AT_byte_size, 0) * 8;
+    if (layout_info.bit_size == 0) {
+      auto byte_size =
+          die.GetAttributeValueAsUnsigned(DW_AT_byte_size, UINT64_MAX);
+
+      if (byte_size != UINT64_MAX)
+        layout_info.bit_size = byte_size;
----------------
augusto2112 wrote:

Thanks for catching this.

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


More information about the lldb-commits mailing list