diff options
| author | Pavel Labath <labath@google.com> | 2017-02-10 11:49:21 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2017-02-10 11:49:21 +0000 |
| commit | 5fae71c51cc8c3d51e86cd597ce91a254e9175f4 (patch) | |
| tree | 07566b6e6ea25ad4cd1fe0138e69b3b15650d072 /lldb/source/Plugins/Process/POSIX | |
| parent | 30a02088c0dcf07dcb38bc9fd2f8221154cff449 (diff) | |
| download | bcm5719-llvm-5fae71c51cc8c3d51e86cd597ce91a254e9175f4.tar.gz bcm5719-llvm-5fae71c51cc8c3d51e86cd597ce91a254e9175f4.zip | |
Convert Log class to llvm streams
Summary:
This converts LLDB's logging to use llvm streams instead of
lldb_private::Stream and friends. The changes are mostly
straight-forward and amount to s/lldb_private::Stream/llvm::raw_ostream.
The part worth calling out is the rewrite of the StreamCallback class.
Previously this class contained a per-thread buffer of data written. I
assume this had something to do with it trying to make sure each log
line is delivered as a single event, instead of multiple (possibly
interleaved) events. However, this is no longer relevant as the Log
class already writes things to a temporary buffer and then delivers the
message as a single "write", so I have just removed the code in
question.
Reviewers: zturner, clayborg
Subscribers: emaste, lldb-commits, mgorny
Differential Revision: https://reviews.llvm.org/D29615
llvm-svn: 294736
Diffstat (limited to 'lldb/source/Plugins/Process/POSIX')
| -rw-r--r-- | lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp | 5 | ||||
| -rw-r--r-- | lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.h | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp b/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp index f2d4e38033e..a148b5f9157 100644 --- a/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp +++ b/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp @@ -115,8 +115,9 @@ void ProcessPOSIXLog::DisableLog(const char **args, Stream *feedback_strm) { return; } -Log *ProcessPOSIXLog::EnableLog(StreamSP &log_stream_sp, uint32_t log_options, - const char **args, Stream *feedback_strm) { +Log *ProcessPOSIXLog::EnableLog( + const std::shared_ptr<llvm::raw_ostream> &log_stream_sp, + uint32_t log_options, const char **args, Stream *feedback_strm) { // Try see if there already is a log - that way we can reuse its settings. // We could reuse the log in toto, but we don't know that the stream is the // same. diff --git a/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.h b/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.h index 00af3dd5081..b277349b8d8 100644 --- a/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.h +++ b/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.h @@ -62,9 +62,10 @@ public: static void DisableLog(const char **args, lldb_private::Stream *feedback_strm); - static lldb_private::Log *EnableLog(lldb::StreamSP &log_stream_sp, - uint32_t log_options, const char **args, - lldb_private::Stream *feedback_strm); + static lldb_private::Log * + EnableLog(const std::shared_ptr<llvm::raw_ostream> &log_stream_sp, + uint32_t log_options, const char **args, + lldb_private::Stream *feedback_strm); static void ListLogCategories(lldb_private::Stream *strm); |

