================ @@ -29,6 +29,19 @@ STRING_EXTENSION_OUTSIDE(SBValue) '''An accessor function that returns a children_access() object which allows lazy member variable access from a lldb.SBValue object.''' return self.children_access (self) + def get_member_access_object(self): + '''An accessor function that returns an interface which provides subscript based lookup of child members.''' + class member_access: + def __init__(self, valobj): + self.valobj = valobj + + def __getitem__(self, key): + if isinstance(key, str): + return self.valobj.GetChildMemberWithName(key) + raise TypeError("invalid subscript key") ---------------- clayborg wrote:
Do we want to be more clear here and say something other than `"invalid subscript key"`? Do we want to say `"member key values must be string values that specify the name of a member variable to access"`? 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