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

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 9 04:17:32 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)
----------------
Michael137 wrote:

Yea I remember looking into an issue like that for some other formatter. Though this patch doesn't change behaviour in this case. If we had garbage in `__size_`, we previously would've also read its value and treated it as the `count`. The only difference here is that we don't unwrap the `compressed_pair` anymore.

I'll open a follow-up issue for fixing this in a separate PR. In fact, the other issue might still be open somewhere. I'll have a look

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


More information about the lldb-commits mailing list