================
@@ -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
----------------
labath wrote:

The cast, is a noop, right? Any reason to not remove it?

```suggestion
            return internal_child.Dereference()
```

https://github.com/llvm/llvm-project/pull/143786
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to