summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/Core/Debugger.h3
-rw-r--r--lldb/source/Core/Debugger.cpp10
-rw-r--r--lldb/source/DataFormatters/FormatManager.cpp4
3 files changed, 17 insertions, 0 deletions
diff --git a/lldb/include/lldb/Core/Debugger.h b/lldb/include/lldb/Core/Debugger.h
index 857d08a033e..0e9cf9bbda0 100644
--- a/lldb/include/lldb/Core/Debugger.h
+++ b/lldb/include/lldb/Core/Debugger.h
@@ -322,6 +322,9 @@ public:
GetDisassemblyLineCount () const;
bool
+ GetEnableAutoOneLine () const;
+
+ bool
GetNotifyVoid () const;
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 8c05bc61eef..281faf1a6e3 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -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 () const
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 &
diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp
index c4540b5210c..911125b2481 100644
--- a/lldb/source/DataFormatters/FormatManager.cpp
+++ b/lldb/source/DataFormatters/FormatManager.cpp
@@ -334,6 +334,10 @@ FormatManager::GetSingleItemFormat(lldb::Format vector_format)
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)
OpenPOWER on IntegriCloud