From 989e213c180e8cb1cc6946979b4a07b6ce4c8c2d Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Wed, 24 Jun 2015 19:53:22 +0000 Subject: [PATCH] Fix an issue where an SBValue could end up capturing a synthetic value and would then be unable to return the non-synthetic version thereof This patch makes the backing ValueImpl always store the root-most value no matter the "flavor" that is initially passed into it llvm-svn: 240578 --- lldb/source/API/SBValue.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp index 72f30e3..ef62c30 100644 --- a/lldb/source/API/SBValue.cpp +++ b/lldb/source/API/SBValue.cpp @@ -61,13 +61,19 @@ public: lldb::DynamicValueType use_dynamic, bool use_synthetic, const char *name = NULL) : - m_valobj_sp(in_valobj_sp), + m_valobj_sp(), m_use_dynamic(use_dynamic), m_use_synthetic(use_synthetic), m_name (name) { - if (!m_name.IsEmpty() && m_valobj_sp) - m_valobj_sp->SetName(m_name); + if (in_valobj_sp) + { + if ( (m_valobj_sp = in_valobj_sp->GetQualifiedRepresentationIfAvailable(lldb::eNoDynamicValues, false)) ) + { + if (!m_name.IsEmpty()) + m_valobj_sp->SetName(m_name); + } + } } ValueImpl (const ValueImpl& rhs) : -- 2.7.4