summaryrefslogtreecommitdiff
path: root/lldb/source/Core/IOHandler.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-11-16 21:15:24 +0000
committerZachary Turner <zturner@google.com>2016-11-16 21:15:24 +0000
commit75e2ff7fb0216e3ff168a9af06aac236fcce02da (patch)
treed7656940546273d77f88117071b98a64bc6ee901 /lldb/source/Core/IOHandler.cpp
parent2cc783b03d68a3e78c24f980daec8b9abd2dda62 (diff)
Don't allow direct access to StreamString's internal buffer.
This is a large API change that removes the two functions from StreamString that return a std::string& and a const std::string&, and instead provide one function which returns a StringRef. Direct access to the underlying buffer violates the concept of a "stream" which is intended to provide forward only access, and makes porting to llvm::raw_ostream more difficult in the future. Differential Revision: https://reviews.llvm.org/D26698
Diffstat (limited to 'lldb/source/Core/IOHandler.cpp')
-rw-r--r--lldb/source/Core/IOHandler.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/lldb/source/Core/IOHandler.cpp b/lldb/source/Core/IOHandler.cpp
index 315d20ed24b..e123fdb1431 100644
--- a/lldb/source/Core/IOHandler.cpp
+++ b/lldb/source/Core/IOHandler.cpp
@@ -2422,7 +2422,7 @@ public:
if (FormatEntity::Format(m_format, strm, &sc, &exe_ctx, nullptr,
nullptr, false, false)) {
int right_pad = 1;
- window.PutCStringTruncated(strm.GetString().c_str(), right_pad);
+ window.PutCStringTruncated(strm.GetString().str().c_str(), right_pad);
}
}
}
@@ -2481,7 +2481,7 @@ public:
if (FormatEntity::Format(m_format, strm, nullptr, &exe_ctx, nullptr,
nullptr, false, false)) {
int right_pad = 1;
- window.PutCStringTruncated(strm.GetString().c_str(), right_pad);
+ window.PutCStringTruncated(strm.GetString().str().c_str(), right_pad);
}
}
}
@@ -2571,7 +2571,7 @@ public:
if (FormatEntity::Format(m_format, strm, nullptr, &exe_ctx, nullptr,
nullptr, false, false)) {
int right_pad = 1;
- window.PutCStringTruncated(strm.GetString().c_str(), right_pad);
+ window.PutCStringTruncated(strm.GetString().str().c_str(), right_pad);
}
}
}
@@ -3312,7 +3312,7 @@ HelpDialogDelegate::HelpDialogDelegate(const char *text,
StreamString key_description;
key_description.Printf("%10s - %s", CursesKeyToCString(key->ch),
key->description);
- m_text.AppendString(std::move(key_description.GetString()));
+ m_text.AppendString(key_description.GetString());
}
}
}
@@ -3597,8 +3597,8 @@ public:
thread_menu_title.Printf(" %s", queue_name);
}
menu.AddSubmenu(
- MenuSP(new Menu(thread_menu_title.GetString().c_str(), nullptr,
- menu_char, thread_sp->GetID())));
+ MenuSP(new Menu(thread_menu_title.GetString().str().c_str(),
+ nullptr, menu_char, thread_sp->GetID())));
}
} else if (submenus.size() > 7) {
// Remove the separator and any other thread submenu items
@@ -3757,7 +3757,7 @@ public:
if (thread && FormatEntity::Format(m_format, strm, nullptr, &exe_ctx,
nullptr, nullptr, false, false)) {
window.MoveCursor(40, 0);
- window.PutCStringTruncated(strm.GetString().c_str(), 1);
+ window.PutCStringTruncated(strm.GetString().str().c_str(), 1);
}
window.MoveCursor(60, 0);
@@ -3986,7 +3986,7 @@ public:
window.AttributeOn(A_REVERSE);
window.MoveCursor(1, 1);
window.PutChar(' ');
- window.PutCStringTruncated(m_title.GetString().c_str(), 1);
+ window.PutCStringTruncated(m_title.GetString().str().c_str(), 1);
int x = window.GetCursorX();
if (x < window_width - 1) {
window.Printf("%*s", window_width - x - 1, "");
@@ -4208,7 +4208,7 @@ public:
strm.Printf("%s", mnemonic);
int right_pad = 1;
- window.PutCStringTruncated(strm.GetString().c_str(), right_pad);
+ window.PutCStringTruncated(strm.GetData(), right_pad);
if (is_pc_line && frame_sp &&
frame_sp->GetConcreteFrameIndex() == 0) {