[Lldb-commits] [lldb] r166119 - in /lldb/trunk: include/lldb/Core/ValueObject.h source/Core/ValueObject.cpp source/Core/ValueObjectDynamicValue.cpp

Enrico Granata egranata at apple.com
Wed Oct 17 12:03:34 PDT 2012


Author: enrico
Date: Wed Oct 17 14:03:34 2012
New Revision: 166119

URL: http://llvm.org/viewvc/llvm-project?rev=166119&view=rev
Log:
<rdar://problem/12503640> Fixing an issue where the dynamic type of an Objective-C pointer changed but we still reported the one-true-definition for the previous type. This was causing issues where a variable could be reported as being of an entirely different type after an assignment

Modified:
    lldb/trunk/include/lldb/Core/ValueObject.h
    lldb/trunk/source/Core/ValueObject.cpp
    lldb/trunk/source/Core/ValueObjectDynamicValue.cpp

Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=166119&r1=166118&r2=166119&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Wed Oct 17 14:03:34 2012
@@ -1265,6 +1265,9 @@
     DataExtractor &
     GetDataExtractor ();
     
+    void
+    ResetCompleteTypeInfo ();
+    
     //------------------------------------------------------------------
     // Sublasses must implement the functions below.
     //------------------------------------------------------------------

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=166119&r1=166118&r2=166119&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Wed Oct 17 14:03:34 2012
@@ -274,6 +274,13 @@
     ClearUserVisibleData(eClearUserVisibleDataItemsValue);
 }
 
+void
+ValueObject::ResetCompleteTypeInfo ()
+{
+    m_did_calculate_complete_objc_class_type = false;
+    m_override_type = ClangASTType();
+}
+
 ClangASTType
 ValueObject::MaybeCalculateCompleteType ()
 {

Modified: lldb/trunk/source/Core/ValueObjectDynamicValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectDynamicValue.cpp?rev=166119&r1=166118&r2=166119&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectDynamicValue.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectDynamicValue.cpp Wed Oct 17 14:03:34 2012
@@ -290,12 +290,14 @@
     if (!m_type_sp)
     {
         m_type_sp = dynamic_type_sp;
+        ResetCompleteTypeInfo ();
     }
     else if (dynamic_type_sp != m_type_sp)
     {
         // We are another type, we need to tear down our children...
         m_type_sp = dynamic_type_sp;
         SetValueDidChange (true);
+        ResetCompleteTypeInfo ();
     }
     
     if (!m_address.IsValid() || m_address != dynamic_address)





More information about the lldb-commits mailing list