summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Interpreter')
-rw-r--r--lldb/source/Interpreter/OptionValueArray.cpp26
-rw-r--r--lldb/source/Interpreter/OptionValueDictionary.cpp14
-rw-r--r--lldb/source/Interpreter/OptionValueFileSpecLIst.cpp20
-rw-r--r--lldb/source/Interpreter/OptionValueFormatEntity.cpp4
-rw-r--r--lldb/source/Interpreter/OptionValueLanguage.cpp3
-rw-r--r--lldb/source/Interpreter/Property.cpp3
6 files changed, 50 insertions, 20 deletions
diff --git a/lldb/source/Interpreter/OptionValueArray.cpp b/lldb/source/Interpreter/OptionValueArray.cpp
index d3fd1cb5db4..3a4e2c4f897 100644
--- a/lldb/source/Interpreter/OptionValueArray.cpp
+++ b/lldb/source/Interpreter/OptionValueArray.cpp
@@ -31,13 +31,17 @@ void OptionValueArray::DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
strm.Printf("(%s)", GetTypeAsCString());
}
if (dump_mask & eDumpOptionValue) {
- if (dump_mask & eDumpOptionType)
- strm.Printf(" =%s", (m_values.size() > 0) ? "\n" : "");
- strm.IndentMore();
+ const bool one_line = dump_mask & eDumpOptionCommand;
const uint32_t size = m_values.size();
+ if (dump_mask & eDumpOptionType)
+ strm.Printf(" =%s", (m_values.size() > 0 && !one_line) ? "\n" : "");
+ if (!one_line)
+ strm.IndentMore();
for (uint32_t i = 0; i < size; ++i) {
- strm.Indent();
- strm.Printf("[%u]: ", i);
+ if (!one_line) {
+ strm.Indent();
+ strm.Printf("[%u]: ", i);
+ }
const uint32_t extra_dump_options = m_raw_value_dump ? eDumpOptionRaw : 0;
switch (array_element_type) {
default:
@@ -63,10 +67,16 @@ void OptionValueArray::DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
extra_dump_options);
break;
}
- if (i < (size - 1))
- strm.EOL();
+
+ if (!one_line) {
+ if (i < (size - 1))
+ strm.EOL();
+ } else {
+ strm << ' ';
+ }
}
- strm.IndentLess();
+ if (!one_line)
+ strm.IndentLess();
}
}
diff --git a/lldb/source/Interpreter/OptionValueDictionary.cpp b/lldb/source/Interpreter/OptionValueDictionary.cpp
index 73aa617f58f..7103ea2c3e5 100644
--- a/lldb/source/Interpreter/OptionValueDictionary.cpp
+++ b/lldb/source/Interpreter/OptionValueDictionary.cpp
@@ -33,16 +33,23 @@ void OptionValueDictionary::DumpValue(const ExecutionContext *exe_ctx,
strm.Printf("(%s)", GetTypeAsCString());
}
if (dump_mask & eDumpOptionValue) {
+ const bool one_line = dump_mask & eDumpOptionCommand;
if (dump_mask & eDumpOptionType)
strm.PutCString(" =");
collection::iterator pos, end = m_values.end();
- strm.IndentMore();
+ if (!one_line)
+ strm.IndentMore();
for (pos = m_values.begin(); pos != end; ++pos) {
OptionValue *option_value = pos->second.get();
- strm.EOL();
+
+ if (one_line)
+ strm << ' ';
+ else
+ strm.EOL();
+
strm.Indent(pos->first.GetCString());
const uint32_t extra_dump_options = m_raw_value_dump ? eDumpOptionRaw : 0;
@@ -74,7 +81,8 @@ void OptionValueDictionary::DumpValue(const ExecutionContext *exe_ctx,
break;
}
}
- strm.IndentLess();
+ if (!one_line)
+ strm.IndentLess();
}
}
diff --git a/lldb/source/Interpreter/OptionValueFileSpecLIst.cpp b/lldb/source/Interpreter/OptionValueFileSpecLIst.cpp
index 7fdc3c78023..94dc9b61949 100644
--- a/lldb/source/Interpreter/OptionValueFileSpecLIst.cpp
+++ b/lldb/source/Interpreter/OptionValueFileSpecLIst.cpp
@@ -25,16 +25,24 @@ void OptionValueFileSpecList::DumpValue(const ExecutionContext *exe_ctx,
if (dump_mask & eDumpOptionType)
strm.Printf("(%s)", GetTypeAsCString());
if (dump_mask & eDumpOptionValue) {
- if (dump_mask & eDumpOptionType)
- strm.Printf(" =%s", m_current_value.GetSize() > 0 ? "\n" : "");
- strm.IndentMore();
+ const bool one_line = dump_mask & eDumpOptionCommand;
const uint32_t size = m_current_value.GetSize();
+ if (dump_mask & eDumpOptionType)
+ strm.Printf(" =%s",
+ (m_current_value.GetSize() > 0 && !one_line) ? "\n" : "");
+ if (!one_line)
+ strm.IndentMore();
for (uint32_t i = 0; i < size; ++i) {
- strm.Indent();
- strm.Printf("[%u]: ", i);
+ if (!one_line) {
+ strm.Indent();
+ strm.Printf("[%u]: ", i);
+ }
m_current_value.GetFileSpecAtIndex(i).Dump(&strm);
+ if (one_line)
+ strm << ' ';
}
- strm.IndentLess();
+ if (!one_line)
+ strm.IndentLess();
}
}
diff --git a/lldb/source/Interpreter/OptionValueFormatEntity.cpp b/lldb/source/Interpreter/OptionValueFormatEntity.cpp
index 3501423a732..98505947fa7 100644
--- a/lldb/source/Interpreter/OptionValueFormatEntity.cpp
+++ b/lldb/source/Interpreter/OptionValueFormatEntity.cpp
@@ -61,10 +61,10 @@ void OptionValueFormatEntity::DumpValue(const ExecutionContext *exe_ctx,
strm.Printf("(%s)", GetTypeAsCString());
if (dump_mask & eDumpOptionValue) {
if (dump_mask & eDumpOptionType)
- strm.PutCString(" = \"");
+ strm.PutCString(" = ");
std::string escaped;
EscapeBackticks(m_current_format, escaped);
- strm << escaped << '"';
+ strm << '"' << escaped << '"';
}
}
diff --git a/lldb/source/Interpreter/OptionValueLanguage.cpp b/lldb/source/Interpreter/OptionValueLanguage.cpp
index 1a82329bf0f..1f0e6fddc53 100644
--- a/lldb/source/Interpreter/OptionValueLanguage.cpp
+++ b/lldb/source/Interpreter/OptionValueLanguage.cpp
@@ -28,7 +28,8 @@ void OptionValueLanguage::DumpValue(const ExecutionContext *exe_ctx,
if (dump_mask & eDumpOptionValue) {
if (dump_mask & eDumpOptionType)
strm.PutCString(" = ");
- strm.PutCString(Language::GetNameForLanguageType(m_current_value));
+ if (m_current_value != eLanguageTypeUnknown)
+ strm.PutCString(Language::GetNameForLanguageType(m_current_value));
}
}
diff --git a/lldb/source/Interpreter/Property.cpp b/lldb/source/Interpreter/Property.cpp
index 369029bc570..2c3e3728a37 100644
--- a/lldb/source/Interpreter/Property.cpp
+++ b/lldb/source/Interpreter/Property.cpp
@@ -233,7 +233,10 @@ void Property::Dump(const ExecutionContext *exe_ctx, Stream &strm,
uint32_t dump_mask) const {
if (m_value_sp) {
const bool dump_desc = dump_mask & OptionValue::eDumpOptionDescription;
+ const bool dump_cmd = dump_mask & OptionValue::eDumpOptionCommand;
const bool transparent = m_value_sp->ValueIsTransparent();
+ if (dump_cmd && !transparent)
+ strm << "settings set -f ";
if (dump_desc || !transparent) {
if ((dump_mask & OptionValue::eDumpOptionName) && m_name) {
DumpQualifiedName(strm);
OpenPOWER on IntegriCloud