[Lldb-commits] [lldb] [lldb] Support new libc++ __compressed_pair layout (PR #96538)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 8 22:52:50 PDT 2024


================
@@ -734,9 +740,13 @@ def update(self):
             # variable tells which element in this NxM array is the 0th
             # one, and the 'size' element gives the number of elements
             # in the deque.
-            count = self._get_value_of_compressed_pair(
-                self.valobj.GetChildMemberWithName("__size_")
-            )
+            if has_compressed_pair_layout:
+                count = self._get_value_of_compressed_pair(
+                    self.valobj.GetChildMemberWithName("__size_")
+                )
+            else:
+                count = size_valobj.GetValueAsUnsigned(0)
----------------
clayborg wrote:

Is there any verification we can do on this to ensure the data in this object is not just random data because the class hasn't been initialized? We had an issue with `std::initializer_list<T>` being super simple and if random data was in the object, its size could be huge. Can we verify the alignment of anything like `__begin_` or `__end_cap_` and if anything look really off or not aligned correctly return zero as the count?

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


More information about the lldb-commits mailing list