From 75e2ff7fb0216e3ff168a9af06aac236fcce02da Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 16 Nov 2016 21:15:24 +0000 Subject: 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 --- lldb/source/Core/IOHandler.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lldb/source/Core/IOHandler.cpp') 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) { -- cgit v1.2.3