[Lldb-commits] [lldb] r167803 - in /lldb/trunk/include/lldb: Core/FormatNavigator.h Core/ValueObjectSyntheticFilter.h lldb-private-enumerations.h

Enrico Granata egranata at apple.com
Mon Nov 12 18:05:46 PST 2012


Author: enrico
Date: Mon Nov 12 20:05:45 2012
New Revision: 167803

URL: http://llvm.org/viewvc/llvm-project?rev=167803&view=rev
Log:
<rdar://problem/11814875>

If a ValueObjectDynamic has no formatter, try using its static type to figure one out


Modified:
    lldb/trunk/include/lldb/Core/FormatNavigator.h
    lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
    lldb/trunk/include/lldb/lldb-private-enumerations.h

Modified: lldb/trunk/include/lldb/Core/FormatNavigator.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatNavigator.h?rev=167803&r1=167802&r2=167803&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/FormatNavigator.h (original)
+++ lldb/trunk/include/lldb/Core/FormatNavigator.h Mon Nov 12 20:05:45 2012
@@ -633,6 +633,25 @@
                 return true;
             }
         }
+        
+        // if all else fails, go to static type
+        if (valobj.IsDynamic())
+        {
+            if (log)
+                log->Printf("[Get] going to static value");
+            lldb::ValueObjectSP static_value_sp(valobj.GetStaticValue());
+            if (static_value_sp)
+            {
+                if (log)
+                    log->Printf("[Get] has a static value - actually use it");
+                if (Get(*static_value_sp.get(), clang::QualType::getFromOpaquePtr(static_value_sp->GetClangType()) , entry, use_dynamic, reason))
+                {
+                    reason |= lldb_private::eFormatterChoiceCriterionWentToStaticValue;
+                    return true;
+                }
+            }
+        }
+        
         return false;
     }
 };

Modified: lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h?rev=167803&r1=167802&r2=167803&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h Mon Nov 12 20:05:45 2012
@@ -77,12 +77,9 @@
     virtual bool
     IsDynamic ()
     {
-        if (m_parent)
-            return m_parent->IsDynamic();
-        else
-            return false;
+        return false;
     }
-    
+
     virtual ValueObject *
     GetParent()
     {

Modified: lldb/trunk/include/lldb/lldb-private-enumerations.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-enumerations.h?rev=167803&r1=167802&r2=167803&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-private-enumerations.h (original)
+++ lldb/trunk/include/lldb/lldb-private-enumerations.h Mon Nov 12 20:05:45 2012
@@ -213,7 +213,8 @@
     eFormatterChoiceCriterionRegularExpressionSummary =      0x00000004,
     eFormatterChoiceCriterionRegularExpressionFilter =       0x00000004,
     eFormatterChoiceCriterionDynamicObjCDiscovery =          0x00000008,
-    eFormatterChoiceCriterionStrippedBitField =              0x00000010
+    eFormatterChoiceCriterionStrippedBitField =              0x00000010,
+    eFormatterChoiceCriterionWentToStaticValue =             0x00000020
 } FormatterChoiceCriterion;
 
 //----------------------------------------------------------------------





More information about the lldb-commits mailing list