================
@@ -325,13 +326,33 @@ def __init__(
                          children.
         :param dereference: A ValueCheck for the SBValue returned by the
                             `Dereference` function.
+        :param valobj: If supplied, ignore the other arguments and build a
+                       ValueCheck that matches valobj except for the name
+                       of the toplevel valobj.
         """
-        self.expect_name = name
-        self.expect_value = value
-        self.expect_type = type
-        self.expect_summary = summary
-        self.children = children
-        self.dereference = dereference
+        if valobj:
+            # SBValues so we don't need to dereference
+            self.dereference = None
+            # We don't want to compare the top-level VO
+            # name as the reference object may come from
+            # a different source.  So we pass that in in
+            # the recursive part by hand below.
+
+            self.expect_name = name
+            # Copy everything else from the incoming valobj:
+            self.expect_summary = valobj.GetSummary()
+            self.expect_type = valobj.GetDisplayTypeName()
+            self.expect_value = valobj.GetValue()
+            self.children: [ValueCheck] = []
----------------
medismailben wrote:

```suggestion
            self.children = []
```

https://github.com/llvm/llvm-project/pull/216208
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to