[Lldb-commits] [lldb] cd7eaaa - [lldb] Add color support to StreamString (#77380)
via lldb-commits
lldb-commits at lists.llvm.org
Wed Jan 10 10:13:19 PST 2024
Author: Pete Lawrence
Date: 2024-01-10T10:13:14-08:00
New Revision: cd7eaaa6db0dc9a00a097ba8e6ebad6fb2dec56a
URL: https://github.com/llvm/llvm-project/commit/cd7eaaa6db0dc9a00a097ba8e6ebad6fb2dec56a
DIFF: https://github.com/llvm/llvm-project/commit/cd7eaaa6db0dc9a00a097ba8e6ebad6fb2dec56a.diff
LOG: [lldb] Add color support to StreamString (#77380)
This change just adds a `bool colors` parameter to the `StreamString`
class's constructor, which it passes up to its superclass’s constructor.
I'm working on another patch that prints out error messages using a
`StreamString` but I wasn't getting colorized text because of this
missing implementation detail.
rdar://120671168
Added:
Modified:
lldb/include/lldb/Utility/StreamString.h
lldb/source/Utility/StreamString.cpp
Removed:
################################################################################
diff --git a/lldb/include/lldb/Utility/StreamString.h b/lldb/include/lldb/Utility/StreamString.h
index 4c568acdcc6f60..3d675caf8f3f43 100644
--- a/lldb/include/lldb/Utility/StreamString.h
+++ b/lldb/include/lldb/Utility/StreamString.h
@@ -22,7 +22,7 @@ namespace lldb_private {
class StreamString : public Stream {
public:
- StreamString();
+ StreamString(bool colors = false);
StreamString(uint32_t flags, uint32_t addr_size, lldb::ByteOrder byte_order);
diff --git a/lldb/source/Utility/StreamString.cpp b/lldb/source/Utility/StreamString.cpp
index 745a85b7576520..0d35ccbdbbd0f5 100644
--- a/lldb/source/Utility/StreamString.cpp
+++ b/lldb/source/Utility/StreamString.cpp
@@ -11,7 +11,7 @@
using namespace lldb;
using namespace lldb_private;
-StreamString::StreamString() : Stream(0, 4, eByteOrderBig) {}
+StreamString::StreamString(bool colors) : Stream(0, 4, eByteOrderBig, colors) {}
StreamString::StreamString(uint32_t flags, uint32_t addr_size,
ByteOrder byte_order)
More information about the lldb-commits
mailing list