[Lldb-commits] [lldb] [lldb][breakpointoptions] Make disabled keyword red (PR #91404)

via lldb-commits lldb-commits at lists.llvm.org
Tue May 7 18:10:12 PDT 2024


================
@@ -534,7 +534,8 @@ void BreakpointOptions::GetDescription(Stream *s,
 
     if (m_ignore_count > 0)
       s->Printf("ignore: %d ", m_ignore_count);
-    s->Printf("%sabled ", m_enabled ? "en" : "dis");
+    s->PutCStringColorHighlighted(m_enabled ? "enabled " : "disabled ",
+                                  m_disbaled_breakpoint_highlight_settings);
----------------
jimingham wrote:

This wouldn't be a problem if we make sure that whoever makes the Streams for use by the command interpreter consults GetUseColor when it creates the stream, and then we can rely on the stream to tell us what to do.  If you are calling stream API's that add the color for you, that should just work.  If you are doing a Print by hand with the color codes or not, you should consult the stream.  For that we'll have to add Stream::GetUseColor.  If we always get that right, the only problem will be if there are persistent streams, we may need to change their state or replace them when GetUseColor changes.

That seems the most principled way to solve this.

https://github.com/llvm/llvm-project/pull/91404


More information about the lldb-commits mailing list