[Lldb-commits] [lldb] [lldb] Add color support to StreamString (PR #77380)

Pete Lawrence via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 8 13:44:49 PST 2024


https://github.com/PortalPete created https://github.com/llvm/llvm-project/pull/77380

This change just adds a `bool colors` parameter to the `StreamString` class's constructor, which it passes up to its superclass’s constructor.

rdar://120671168

>From 6ee5afb1a5f0f5e2070bfb0fb70f4a51bcd6ef9f Mon Sep 17 00:00:00 2001
From: Pete Lawrence <plawrence at apple.com>
Date: Fri, 5 Jan 2024 20:02:46 -1000
Subject: [PATCH] [lldb] Add color support to StreamString
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This change just adds a `bool colors` parameter to the `StreamString` class's constructor, which it passes up to its superclass’s constructor.

rdar://120671168
---
 lldb/include/lldb/Utility/StreamString.h | 2 +-
 lldb/source/Utility/StreamString.cpp     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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