summaryrefslogtreecommitdiffstats
path: root/lldb/source/Breakpoint/BreakpointOptions.cpp
diff options
context:
space:
mode:
authorRaphael Isemann <risemann@apple.com>2019-11-30 15:30:08 +0100
committerRaphael Isemann <teemperor@gmail.com>2019-12-02 13:27:21 +0100
commit4f728bfc13c45bc744bfdbfc3086bed74a8cbb4c (patch)
tree8770c087af4aba341ba85880dd369416b5942a10 /lldb/source/Breakpoint/BreakpointOptions.cpp
parent76b70f6f75e90074bf2f5168383cc3afc21b61ad (diff)
downloadbcm5719-llvm-4f728bfc13c45bc744bfdbfc3086bed74a8cbb4c.tar.gz
bcm5719-llvm-4f728bfc13c45bc744bfdbfc3086bed74a8cbb4c.zip
[lldb][NFC] Use raw_ostream instead of Stream in Baton::GetDescription
Removing raw_ostream here is getting us closer to removing LLDB's Stream class.
Diffstat (limited to 'lldb/source/Breakpoint/BreakpointOptions.cpp')
-rw-r--r--lldb/source/Breakpoint/BreakpointOptions.cpp37
1 files changed, 18 insertions, 19 deletions
diff --git a/lldb/source/Breakpoint/BreakpointOptions.cpp b/lldb/source/Breakpoint/BreakpointOptions.cpp
index 0d4c6173c3c..8fd16f420c0 100644
--- a/lldb/source/Breakpoint/BreakpointOptions.cpp
+++ b/lldb/source/Breakpoint/BreakpointOptions.cpp
@@ -566,7 +566,8 @@ void BreakpointOptions::GetDescription(Stream *s,
if (m_callback_baton_sp.get()) {
if (level != eDescriptionLevelBrief) {
s->EOL();
- m_callback_baton_sp->GetDescription(s, level);
+ m_callback_baton_sp->GetDescription(s->AsRawOstream(), level,
+ s->GetIndentLevel());
}
}
if (!m_condition_text.empty()) {
@@ -578,35 +579,33 @@ void BreakpointOptions::GetDescription(Stream *s,
}
void BreakpointOptions::CommandBaton::GetDescription(
- Stream *s, lldb::DescriptionLevel level) const {
+ llvm::raw_ostream &s, lldb::DescriptionLevel level,
+ unsigned indentation) const {
const CommandData *data = getItem();
if (level == eDescriptionLevelBrief) {
- s->Printf(", commands = %s",
- (data && data->user_source.GetSize() > 0) ? "yes" : "no");
+ s << ", commands = "
+ << ((data && data->user_source.GetSize() > 0) ? "yes" : "no");
return;
}
- s->IndentMore();
- s->Indent("Breakpoint commands");
+ indentation += 2;
+ s.indent(indentation);
+ s << "Breakpoint commands";
if (data->interpreter != eScriptLanguageNone)
- s->Printf(" (%s):\n",
- ScriptInterpreter::LanguageToString(data->interpreter).c_str());
+ s << llvm::formatv(" ({0}):\n",
+ ScriptInterpreter::LanguageToString(data->interpreter));
else
- s->PutCString(":\n");
+ s << ":\n";
- s->IndentMore();
+ indentation += 2;
if (data && data->user_source.GetSize() > 0) {
- const size_t num_strings = data->user_source.GetSize();
- for (size_t i = 0; i < num_strings; ++i) {
- s->Indent(data->user_source.GetStringAtIndex(i));
- s->EOL();
+ for (llvm::StringRef str : data->user_source) {
+ s.indent(indentation);
+ s << str << "\n";
}
- } else {
- s->PutCString("No commands.\n");
- }
- s->IndentLess();
- s->IndentLess();
+ } else
+ s << "No commands.\n";
}
void BreakpointOptions::SetCommandDataCallback(
OpenPOWER on IntegriCloud