diff options
author | Pavel Labath <labath@google.com> | 2017-11-07 22:17:29 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2017-11-07 22:17:29 +0000 |
commit | 4c0461f8ce263a95c80d5c58594dfd2435ee6cbf (patch) | |
tree | 6d6765180f2e05ec07bb39d44ec50923c8d79ab2 /lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp | |
parent | da9e0bd3a238f80b05a3070c8a8a3cadadc12e5f (diff) | |
download | bcm5719-llvm-4c0461f8ce263a95c80d5c58594dfd2435ee6cbf.tar.gz bcm5719-llvm-4c0461f8ce263a95c80d5c58594dfd2435ee6cbf.zip |
Update tuple/list/deque data formatters to work with newest libc++
Summary:
A couple of members of these data structures have been renamed in recent
months. This makes sure they still work with the latest libc++ version.
Reviewers: jingham, EricWF
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D39602
llvm-svn: 317624
Diffstat (limited to 'lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp')
-rw-r--r-- | lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp index 66b3a746b9e..3a8bc2087f8 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp @@ -298,6 +298,15 @@ ValueObjectSP ForwardListFrontEnd::GetChildAtIndex(size_t idx) { m_element_type); } +static ValueObjectSP GetValueOfCompressedPair(ValueObject &pair) { + ValueObjectSP value = pair.GetChildMemberWithName(ConstString("__value_"), true); + if (! value) { + // pre-r300140 member name + value = pair.GetChildMemberWithName(ConstString("__first_"), true); + } + return value; +} + bool ForwardListFrontEnd::Update() { AbstractListFrontEnd::Update(); @@ -310,7 +319,7 @@ bool ForwardListFrontEnd::Update() { m_backend.GetChildMemberWithName(ConstString("__before_begin_"), true)); if (!impl_sp) return false; - impl_sp = impl_sp->GetChildMemberWithName(ConstString("__first_"), true); + impl_sp = GetValueOfCompressedPair(*impl_sp); if (!impl_sp) return false; m_head = impl_sp->GetChildMemberWithName(ConstString("__next_"), true).get(); @@ -331,10 +340,9 @@ size_t ListFrontEnd::CalculateNumChildren() { ValueObjectSP size_alloc( m_backend.GetChildMemberWithName(ConstString("__size_alloc_"), true)); if (size_alloc) { - ValueObjectSP first( - size_alloc->GetChildMemberWithName(ConstString("__first_"), true)); - if (first) { - m_count = first->GetValueAsUnsigned(UINT32_MAX); + ValueObjectSP value = GetValueOfCompressedPair(*size_alloc); + if (value) { + m_count = value->GetValueAsUnsigned(UINT32_MAX); } } if (m_count != UINT32_MAX) { |