[Lldb-commits] [lldb] r239874 - Revert r239873 - I actually want to think some more about this

Enrico Granata egranata at apple.com
Tue Jun 16 19:11:49 PDT 2015


Author: enrico
Date: Tue Jun 16 21:11:48 2015
New Revision: 239874

URL: http://llvm.org/viewvc/llvm-project?rev=239874&view=rev
Log:
Revert r239873 - I actually want to think some more about this


Modified:
    lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
    lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp
    lldb/trunk/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
    lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py

Modified: lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h?rev=239874&r1=239873&r2=239874&view=diff
==============================================================================
--- lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h Tue Jun 16 21:11:48 2015
@@ -22,8 +22,6 @@
 #include "lldb/Core/ValueObject.h"
 #include "lldb/DataFormatters/TypeSummary.h"
 
-#include "llvm/ADT/Optional.h"
-
 namespace lldb_private {
 
 struct DumpValueObjectOptions
@@ -373,9 +371,6 @@ protected:
     bool
     PrintChildrenOneLiner (bool hide_names);
     
-    lldb::Format
-    GetFormatForChildElements ();
-    
 private:
     
     ValueObject *m_orig_valobj;
@@ -396,7 +391,6 @@ private:
     std::string m_summary;
     std::string m_error;
     std::pair<TypeValidatorResult,std::string> m_validation;
-    llvm::Optional<lldb::Format> m_children_format;
     
     friend struct StringSummaryFormat;
     

Modified: lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp?rev=239874&r1=239873&r2=239874&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp (original)
+++ lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp Tue Jun 16 21:11:48 2015
@@ -83,7 +83,6 @@ ValueObjectPrinter::Init (ValueObject* v
     m_value.assign("");
     m_summary.assign("");
     m_error.assign("");
-    m_children_format.reset();
 }
 
 bool
@@ -503,25 +502,12 @@ ValueObjectPrinter::PrintChildrenPreambl
     }
 }
 
-lldb::Format
-ValueObjectPrinter::GetFormatForChildElements ()
-{
-    // we special case vector types here because for a vector type the format is not trivially passed down but is one of the things
-    // the synthetic child provider uses to decide how to produce children in the first place - in general this might be something
-    // we'd want to expose in some cleaner way, but until there is more than one instance of this, it's hard to design this capability
-    // in a sensible way, so for now, leave this alone as a special case
-    if (m_children_format.hasValue())
-        return m_children_format.getValue();
-    
-    return (m_children_format = m_clang_type.IsVectorType(nullptr, nullptr) ? lldb::eFormatInvalid : options.m_format).getValue();
-}
-
 void
 ValueObjectPrinter::PrintChild (ValueObjectSP child_sp,
                                 uint32_t curr_ptr_depth)
 {
     DumpValueObjectOptions child_options(options);
-    child_options.SetFormat(GetFormatForChildElements()).SetSummary().SetRootValueObjectName();
+    child_options.SetFormat(options.m_format).SetSummary().SetRootValueObjectName();
     child_options.SetScopeChecked(true).SetHideName(options.m_hide_name).SetHideValue(options.m_hide_value)
     .SetOmitSummaryDepth(child_options.m_omit_summary_depth > 1 ? child_options.m_omit_summary_depth - 1 : 0);
     if (child_sp.get())
@@ -644,7 +630,7 @@ ValueObjectPrinter::PrintChildrenOneLine
                 }
                 child_sp->DumpPrintableRepresentation(*m_stream,
                                                       ValueObject::eValueObjectRepresentationStyleSummary,
-                                                      GetFormatForChildElements(),
+                                                      lldb::eFormatInvalid,
                                                       ValueObject::ePrintableRepresentationSpecialCasesDisable);
             }
         }

Modified: lldb/trunk/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py?rev=239874&r1=239873&r2=239874&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py Tue Jun 16 21:11:48 2015
@@ -83,9 +83,6 @@ class FormatPropagationTestCase(TestBase
         Y.SetFormat(lldb.eFormatDefault)
         self.assertTrue(X.GetValue() == "0x00000004", "X is not hex as it asked")
         self.assertTrue(Y.GetValue() == "2", "Y is not defaulted")
-        
-        # check that 'frame variable' propagates the format correctly
-        self.expect('frame variable -f x', substrs=['0x00000004', '0x00000002'])
 
 if __name__ == '__main__':
     import atexit

Modified: lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py?rev=239874&r1=239873&r2=239874&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py Tue Jun 16 21:11:48 2015
@@ -71,7 +71,6 @@ class VectorTypesFormattingTestCase(Test
         
         self.expect("expr -f int16_t[] -- v", substrs=['[0] = 0', '[1] = 16288', '[2] = 0', '[3] = 16288', '[4] = 0', '[5] = 16416', '[6] = 0', '[7] = 16416'])
         self.expect("expr -f uint128_t[] -- v", substrs=['[0] = 85236745249553456609335044694184296448'])
-        self.expect("expr -f x -- v", substrs=['[0] = 0x3fa00000', '[3] = 0x40200000'])
         
         oldValue = v.GetChildAtIndex(0).GetValue()
         v.SetFormat(lldb.eFormatHex)





More information about the lldb-commits mailing list