[Lldb-commits] [lldb] r240578 - 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

Enrico Granata egranata at apple.com
Wed Jun 24 12:53:22 PDT 2015


Author: enrico
Date: Wed Jun 24 14:53:22 2015
New Revision: 240578

URL: http://llvm.org/viewvc/llvm-project?rev=240578&view=rev
Log:
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


Modified:
    lldb/trunk/source/API/SBValue.cpp

Modified: lldb/trunk/source/API/SBValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBValue.cpp?rev=240578&r1=240577&r2=240578&view=diff
==============================================================================
--- lldb/trunk/source/API/SBValue.cpp (original)
+++ lldb/trunk/source/API/SBValue.cpp Wed Jun 24 14:53:22 2015
@@ -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) :





More information about the lldb-commits mailing list