[Lldb-commits] [PATCH] D11498: Print reference values on one line.

Chaoren Lin chaorenl at google.com
Fri Jul 24 15:31:28 PDT 2015


chaoren created this revision.
chaoren added reviewers: ovyalov, clayborg.
chaoren added a subscriber: lldb-commits.

http://reviews.llvm.org/D11498

Files:
  source/DataFormatters/ValueObjectPrinter.cpp

Index: source/DataFormatters/ValueObjectPrinter.cpp
===================================================================
--- source/DataFormatters/ValueObjectPrinter.cpp
+++ source/DataFormatters/ValueObjectPrinter.cpp
@@ -467,7 +467,7 @@
                 // and it is a reference, and no pointer depth has been supplied
                 // print out what it references. Don't do this at deeper depths
                 // otherwise we can end up with infinite recursion...
-                curr_ptr_depth = 1;
+                return true;
             }
             
             return (curr_ptr_depth > 0);
@@ -650,15 +650,16 @@
     // this flag controls whether we tried to display a description for this object and failed
     // if that happens, we want to display the children, if any
     bool is_failed_description = !PrintObjectDescriptionIfNeeded(value_printed, summary_printed);
-    
+
     uint32_t curr_ptr_depth = m_ptr_depth;
     bool print_children = ShouldPrintChildren (is_failed_description,curr_ptr_depth);
-    bool print_oneline = (curr_ptr_depth > 0 ||
-                          options.m_show_types ||
-                          !options.m_allow_oneliner_mode ||
-                          options.m_flat_output ||
-                          options.m_show_location) ? false : DataVisualization::ShouldPrintAsOneLiner(*m_valobj);
-    
+    bool print_oneline = curr_ptr_depth == 0 &&
+                         !options.m_show_types &&
+                         options.m_allow_oneliner_mode &&
+                         !options.m_flat_output &&
+                         !options.m_show_location &&
+                         DataVisualization::ShouldPrintAsOneLiner(*m_valobj);
+
     if (print_children)
     {
         if (print_oneline)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11498.30617.patch
Type: text/x-patch
Size: 1771 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150724/d622c5cb/attachment.bin>


More information about the lldb-commits mailing list