summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/StreamAsynchronousIO.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Core/StreamAsynchronousIO.cpp')
-rw-r--r--lldb/source/Core/StreamAsynchronousIO.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lldb/source/Core/StreamAsynchronousIO.cpp b/lldb/source/Core/StreamAsynchronousIO.cpp
index b9e5cdfde72..257982ab8b2 100644
--- a/lldb/source/Core/StreamAsynchronousIO.cpp
+++ b/lldb/source/Core/StreamAsynchronousIO.cpp
@@ -28,25 +28,26 @@ StreamAsynchronousIO::StreamAsynchronousIO (Broadcaster &broadcaster, uint32_t b
StreamAsynchronousIO::~StreamAsynchronousIO ()
{
+ // Flush when we destroy to make sure we display the data
+ Flush();
}
void
StreamAsynchronousIO::Flush ()
{
- if (m_accumulated_data.GetSize() > 0)
+ if (!m_accumulated_data.empty())
{
std::unique_ptr<EventDataBytes> data_bytes_ap (new EventDataBytes);
// Let's swap the bytes to avoid LARGE string copies.
- data_bytes_ap->SwapBytes (m_accumulated_data.GetString());
+ data_bytes_ap->SwapBytes (m_accumulated_data);
EventSP new_event_sp (new Event (m_broadcast_event_type, data_bytes_ap.release()));
m_broadcaster.BroadcastEvent (new_event_sp);
- m_accumulated_data.Clear();
}
}
size_t
StreamAsynchronousIO::Write (const void *s, size_t length)
{
- m_accumulated_data.Write (s, length);
+ m_accumulated_data.append ((const char *)s, length);
return length;
}
OpenPOWER on IntegriCloud