diff options
Diffstat (limited to 'source/Interpreter/OptionValueArray.cpp')
-rw-r--r-- | source/Interpreter/OptionValueArray.cpp | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/source/Interpreter/OptionValueArray.cpp b/source/Interpreter/OptionValueArray.cpp index d3fd1cb5db48..d755fa2fddb9 100644 --- a/source/Interpreter/OptionValueArray.cpp +++ b/source/Interpreter/OptionValueArray.cpp @@ -9,10 +9,6 @@ #include "lldb/Interpreter/OptionValueArray.h" -// C Includes -// C++ Includes -// Other libraries and framework includes -// Project includes #include "lldb/Host/StringConvert.h" #include "lldb/Utility/Args.h" #include "lldb/Utility/Stream.h" @@ -31,13 +27,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 +63,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(); } } @@ -215,7 +221,7 @@ Status OptionValueArray::SetArgs(const Args &args, VarSetOperationType op) { if (num_remove_indexes) { // Sort and then erase in reverse so indexes are always valid if (num_remove_indexes > 1) { - std::sort(remove_indexes.begin(), remove_indexes.end()); + llvm::sort(remove_indexes.begin(), remove_indexes.end()); for (std::vector<int>::const_reverse_iterator pos = remove_indexes.rbegin(), end = remove_indexes.rend(); |