bug fix in SBValue::CreateValueFromAddress() where using the resulting VO as a pointer would crash LLDB ; minor improvements in dynamic formatters lookup

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@136743 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBValue.cpp b/source/API/SBValue.cpp
index 229eba5..2973457 100644
--- a/source/API/SBValue.cpp
+++ b/source/API/SBValue.cpp
@@ -457,6 +457,7 @@
                                                                       GetTarget().GetProcess().GetAddressByteSize()));
         
         result_valobj_sp->SetName(ConstString(name));
+        result_valobj_sp->GetValue().SetValueType(Value::eValueTypeLoadAddress);
         result = SBValue(result_valobj_sp);
     }
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
diff --git a/source/Core/ValueObject.cpp b/source/Core/ValueObject.cpp
index 77ee5c1..b742d0b 100644
--- a/source/Core/ValueObject.cpp
+++ b/source/Core/ValueObject.cpp
@@ -77,7 +77,7 @@
     m_deref_valobj(NULL),
     m_format (eFormatDefault),
     m_last_format_mgr_revision(0),
-    m_last_format_mgr_dynamic(lldb::eNoDynamicValues),
+    m_last_format_mgr_dynamic(parent.m_last_format_mgr_dynamic),
     m_last_summary_format(),
     m_forced_summary_format(),
     m_last_value_format(),
@@ -532,7 +532,7 @@
 const char *
 ValueObject::GetSummaryAsCString ()
 {
-    if (UpdateValueIfNeeded (m_last_format_mgr_dynamic, true))
+    if (UpdateValueIfNeeded (true))
     {        
         if (m_summary_str.empty())
         {
@@ -788,7 +788,7 @@
 ValueObject::GetObjectDescription ()
 {
     
-    if (!UpdateValueIfNeeded (m_last_format_mgr_dynamic, true))
+    if (!UpdateValueIfNeeded (true))
         return NULL;
 
     if (!m_object_desc_str.empty())
diff --git a/source/Core/ValueObjectDynamicValue.cpp b/source/Core/ValueObjectDynamicValue.cpp
index beecaa9..f48bebd 100644
--- a/source/Core/ValueObjectDynamicValue.cpp
+++ b/source/Core/ValueObjectDynamicValue.cpp
@@ -40,6 +40,7 @@
     m_type_sp(),
     m_use_dynamic (use_dynamic)
 {
+    m_last_format_mgr_dynamic = use_dynamic;
     SetName (parent.GetName());
 }
 
diff --git a/source/Core/ValueObjectSyntheticFilter.cpp b/source/Core/ValueObjectSyntheticFilter.cpp
index 03b9f12..f48597e 100644
--- a/source/Core/ValueObjectSyntheticFilter.cpp
+++ b/source/Core/ValueObjectSyntheticFilter.cpp
@@ -64,7 +64,7 @@
 ConstString
 ValueObjectSynthetic::GetTypeName()
 {
-    const bool success = UpdateValueIfNeeded();
+    const bool success = UpdateValueIfNeeded(false);
     if (success && m_type_sp)
         return ClangASTType::GetConstTypeName (GetClangType());
     else
@@ -90,7 +90,7 @@
 size_t
 ValueObjectSynthetic::GetByteSize()
 {
-    const bool success = UpdateValueIfNeeded();
+    const bool success = UpdateValueIfNeeded(false);
     if (success && m_type_sp)
         return m_value.GetValueByteSize(GetClangAST(), NULL);
     else
@@ -109,7 +109,7 @@
     SetValueIsValid (false);
     m_error.Clear();
 
-    if (!m_parent->UpdateValueIfNeeded())
+    if (!m_parent->UpdateValueIfNeeded(false))
     {
         // our parent could not update.. as we are meaningless without a parent, just stop
         if (m_error.Success() && m_parent->GetError().Fail())