<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

llvm-svn: 193450
This commit is contained in:
Enrico Granata 2013-10-25 23:09:40 +00:00
parent cbdea323ac
commit 553fad5c9a
3 changed files with 17 additions and 0 deletions

View File

@ -321,6 +321,9 @@ public:
uint32_t
GetDisassemblyLineCount () const;
bool
GetEnableAutoOneLine () const;
bool
GetNotifyVoid () const;

View File

@ -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 &

View File

@ -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)