[Lldb-commits] [lldb] r193450 - <rdar://problem/15319880>

Enrico Granata egranata at apple.com
Fri Oct 25 16:09:40 PDT 2013


Author: enrico
Date: Fri Oct 25 18:09:40 2013
New Revision: 193450

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

Introduce a new boolean setting enable-auto-oneliner
This setting if set to false will force LLDB to not use the new compact one-line display

By default, one-line mode stays on, at least until we can be confident it works.
But now if it seriously impedes your workflow while it evolves/it works wonders but you still hate it, there's a way to turn it off


Modified:
    lldb/trunk/include/lldb/Core/Debugger.h
    lldb/trunk/source/Core/Debugger.cpp
    lldb/trunk/source/DataFormatters/FormatManager.cpp

Modified: lldb/trunk/include/lldb/Core/Debugger.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Debugger.h?rev=193450&r1=193449&r2=193450&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Debugger.h (original)
+++ lldb/trunk/include/lldb/Core/Debugger.h Fri Oct 25 18:09:40 2013
@@ -322,6 +322,9 @@ public:
     GetDisassemblyLineCount () const;
     
     bool
+    GetEnableAutoOneLine () const;
+    
+    bool
     GetNotifyVoid () const;
 
     

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=193450&r1=193449&r2=193450&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Fri Oct 25 18:09:40 2013
@@ -132,6 +132,7 @@ g_properties[] =
 {   "thread-format",            OptionValue::eTypeString , true, 0    , DEFAULT_THREAD_FORMAT, NULL, "The default thread format string to use when displaying thread information." },
 {   "use-external-editor",      OptionValue::eTypeBoolean, true, false, NULL, NULL, "Whether to use an external editor or not." },
 {   "use-color",                OptionValue::eTypeBoolean, true, true , NULL, NULL, "Whether to use Ansi color codes or not." },
+{   "enable-auto-oneliner",     OptionValue::eTypeBoolean, true, true, NULL, NULL, "If true, LLDB will automatically display small structs in one-liner format (default: true)." },
 
     {   NULL,                       OptionValue::eTypeInvalid, true, 0    , NULL, NULL, NULL }
 };
@@ -151,6 +152,7 @@ enum
     ePropertyThreadFormat,
     ePropertyUseExternalEditor,
     ePropertyUseColor,
+    ePropertyEnableAutoOneLine
 };
 
 //
@@ -347,6 +349,14 @@ Debugger::GetDisassemblyLineCount () con
     return m_collection_sp->GetPropertyAtIndexAsSInt64 (NULL, idx, g_properties[idx].default_uint_value);
 }
 
+bool
+Debugger::GetEnableAutoOneLine () const
+{
+    const uint32_t idx = ePropertyEnableAutoOneLine;
+    return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, true);
+
+}
+
 #pragma mark Debugger
 
 //const DebuggerPropertiesSP &

Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=193450&r1=193449&r2=193450&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Fri Oct 25 18:09:40 2013
@@ -334,6 +334,10 @@ FormatManager::GetSingleItemFormat(lldb:
 bool
 FormatManager::ShouldPrintAsOneLiner (ValueObject& valobj)
 {
+    // if settings say no oneline whatsoever
+    if (valobj.GetTargetSP().get() && valobj.GetTargetSP()->GetDebugger().GetEnableAutoOneLine() == false)
+        return false; // then don't oneline
+    
     // if this object has a summary, don't try to do anything special to it
     // if the user wants one-liner, they can ask for it in summary :)
     if (valobj.GetSummaryFormat().get() != nullptr)





More information about the lldb-commits mailing list