diff options
| author | Enrico Granata <egranata@apple.com> | 2013-09-12 00:48:47 +0000 |
|---|---|---|
| committer | Enrico Granata <egranata@apple.com> | 2013-09-12 00:48:47 +0000 |
| commit | e2e220a805b143d9bc8544abedff30204dcf6629 (patch) | |
| tree | 47d3f5773080a2a14d9ff254e1e7ce3d206d2454 /lldb/source/Core/ValueObject.cpp | |
| parent | 872ac4b5f0610fac84aeb1e1925fcf4c0cebf991 (diff) | |
| download | bcm5719-llvm-e2e220a805b143d9bc8544abedff30204dcf6629.tar.gz bcm5719-llvm-e2e220a805b143d9bc8544abedff30204dcf6629.zip | |
<rdar://problem/14071463>
SVN r189964 provided a sample Python script to inspect unordered(multi){set|map} with synthetic children, contribued by Jared Grubb
This checkin converts that sample script to a C++ provider built into LLDB
A test case is also provided
llvm-svn: 190564
Diffstat (limited to 'lldb/source/Core/ValueObject.cpp')
| -rw-r--r-- | lldb/source/Core/ValueObject.cpp | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index a30cc1306c6..8bb285db05d 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -595,6 +595,86 @@ ValueObject::GetChildAtIndexPath (const std::vector< std::pair<size_t, bool> > & return root; } +lldb::ValueObjectSP +ValueObject::GetChildAtNamePath (const std::initializer_list<ConstString> &names, + ConstString* name_of_error) +{ + if (names.size() == 0) + return GetSP(); + ValueObjectSP root(GetSP()); + for (ConstString name : names) + { + root = root->GetChildMemberWithName(name, true); + if (!root) + { + if (name_of_error) + *name_of_error = name; + return root; + } + } + return root; +} + +lldb::ValueObjectSP +ValueObject::GetChildAtNamePath (const std::vector<ConstString> &names, + ConstString* name_of_error) +{ + if (names.size() == 0) + return GetSP(); + ValueObjectSP root(GetSP()); + for (ConstString name : names) + { + root = root->GetChildMemberWithName(name, true); + if (!root) + { + if (name_of_error) + *name_of_error = name; + return root; + } + } + return root; +} + +lldb::ValueObjectSP +ValueObject::GetChildAtNamePath (const std::initializer_list< std::pair<ConstString, bool> > &names, + ConstString* name_of_error) +{ + if (names.size() == 0) + return GetSP(); + ValueObjectSP root(GetSP()); + for (std::pair<ConstString, bool> name : names) + { + root = root->GetChildMemberWithName(name.first, name.second); + if (!root) + { + if (name_of_error) + *name_of_error = name.first; + return root; + } + } + return root; +} + +lldb::ValueObjectSP +ValueObject::GetChildAtNamePath (const std::vector< std::pair<ConstString, bool> > &names, + ConstString* name_of_error) +{ + if (names.size() == 0) + return GetSP(); + ValueObjectSP root(GetSP()); + for (std::pair<ConstString, bool> name : names) + { + root = root->GetChildMemberWithName(name.first, name.second); + if (!root) + { + if (name_of_error) + *name_of_error = name.first; + return root; + } + } + return root; +} + size_t ValueObject::GetIndexOfChildWithName (const ConstString &name) { |

