[Lldb-commits] [lldb] [lldb] Add lookup by name to SBValue through new member property (PR #118814)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Mon Dec 9 05:27:11 PST 2024
================
@@ -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
----------------
labath wrote:
> Is there even an API for this?
I don't think so, but that was sort of my point. If that's what we want to do, then we *should* have an API for that -- instead of trying to work around its absence in python.
https://github.com/llvm/llvm-project/pull/118814
More information about the lldb-commits
mailing list