[Lldb-commits] [lldb] r136743 - in /lldb/trunk/source: API/SBValue.cpp Core/ValueObject.cpp Core/ValueObjectDynamicValue.cpp Core/ValueObjectSyntheticFilter.cpp

Enrico Granata granata.enrico at gmail.com
Tue Aug 2 16:12:24 PDT 2011


Author: enrico
Date: Tue Aug  2 18:12:24 2011
New Revision: 136743

URL: http://llvm.org/viewvc/llvm-project?rev=136743&view=rev
Log:
bug fix in SBValue::CreateValueFromAddress() where using the resulting VO as a pointer would crash LLDB ; minor improvements in dynamic formatters lookup

Modified:
    lldb/trunk/source/API/SBValue.cpp
    lldb/trunk/source/Core/ValueObject.cpp
    lldb/trunk/source/Core/ValueObjectDynamicValue.cpp
    lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp

Modified: lldb/trunk/source/API/SBValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBValue.cpp?rev=136743&r1=136742&r2=136743&view=diff
==============================================================================
--- lldb/trunk/source/API/SBValue.cpp (original)
+++ lldb/trunk/source/API/SBValue.cpp Tue Aug  2 18:12:24 2011
@@ -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));

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=136743&r1=136742&r2=136743&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Tue Aug  2 18:12:24 2011
@@ -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())

Modified: lldb/trunk/source/Core/ValueObjectDynamicValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectDynamicValue.cpp?rev=136743&r1=136742&r2=136743&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectDynamicValue.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectDynamicValue.cpp Tue Aug  2 18:12:24 2011
@@ -40,6 +40,7 @@
     m_type_sp(),
     m_use_dynamic (use_dynamic)
 {
+    m_last_format_mgr_dynamic = use_dynamic;
     SetName (parent.GetName());
 }
 

Modified: lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp?rev=136743&r1=136742&r2=136743&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp Tue Aug  2 18:12:24 2011
@@ -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())





More information about the lldb-commits mailing list