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
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 @@
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) :