[Lldb-commits] [lldb] [LLDB] Update DIL to handle smart pointers; add more tests. (PR #143786)

via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 23 23:03:10 PDT 2025


================
@@ -0,0 +1,32 @@
+import lldb
+
+
+class smartPtrSynthProvider:
+    def __init__(self, valobj, dict):
+        self.valobj = valobj
+
+    def num_children(self):
+        return 1
+
+    def get_child_at_index(self, index):
+        if index == 0:
+            return self.valobj.GetChildMemberWithName("__ptr_")
+        if index == 1:
+            internal_child = self.valobj.GetChildMemberWithName("__ptr_")
+            if not internal_child:
+                return None
+            value_type = internal_child.GetType().GetPointerType()
+            cast_ptr_sp = internal_child.Cast(value_type)
+            value = internal_child.Dereference()
+            return value
----------------
cmtice wrote:

Done

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


More information about the lldb-commits mailing list