[Lldb-commits] [lldb] [lldb] Add SBType::FindNestedType() function (PR #68705)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 13 02:39:42 PDT 2023


================
@@ -119,6 +119,38 @@ def test(self):
 
         self.assertEqual(task_type, task_head_pointee_type)
 
+        # Check whether we can find a directly nested type by name
+        name_type = task_type.FindDirectNestedType("name")
+        self.assertTrue(name_type)
+        self.DebugSBType(name_type)
+
+        enum_type = task_type.FindDirectNestedType("E")
+        self.assertTrue(enum_type)
+        self.DebugSBType(enum_type)
+
+        union_type = task_type.FindDirectNestedType("U")
+        self.assertTrue(union_type)
+        self.DebugSBType(union_type)
+
+        # Check that we don't find indirectly nested types
+
+        self.assertTrue(enum_type.size == 1)
----------------
Michael137 wrote:

Shouldn't we also check that the type we found isn't the one that's inside `struct name`?

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


More information about the lldb-commits mailing list