================ @@ -23,6 +23,13 @@ STRING_EXTENSION_OUTSIDE(SBValue) if -count <= key < count: key %= count return self.sbvalue.GetChildAtIndex(key) + elif isinstance(key, str): + if child := self.sbvalue.GetChildMemberWithName(key): + return child + # Support base classes, which are children but not members. + for child in self.sbvalue: + if child.name == key: + return child ---------------- jimingham wrote:
If you have a class with a base class, `SBValue::GetChildAtIndex(0)` and `var.child[0]` return the base class. So the "child" accessor currently returns both base classes and ivars. Moreover, GetChildMemberWithName actually looks into base classes to pull out ivars (it doesn't however handle duplicate names, it only returns the first one it finds with the matching name which isn't great...) So GetChildMemberWithName will pull out children that aren't even in the indexed `child` array. That does argue to me that `child` is the wrong property to use for this. https://github.com/llvm/llvm-project/pull/118814 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits