[Lldb-commits] [lldb] [lldb][breakpointoptions] Make disabled keyword red (PR #91404)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Tue May 7 14:51:05 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);
----------------
JDevlieghere wrote:
This is going to regex search for disabled and then replace it with its colored variant. That seems unnecessarily inefficient. You know whether you're going to put enabled or disabled, so you could print it colored right away.
You might also have to check the debugger setting for whether colors are enabled (`Debugger::GetUseColor()`). Sometimes it's set at the stream level: the stream might have colors disabled if it was created somewhere were the setting was checked). I don't know if that's always going to be the case here. If it's not, we should check the setting here. To find out I would run lldb with `--no-use-colors` and see if the colors still get printed.
https://github.com/llvm/llvm-project/pull/91404
More information about the lldb-commits
mailing list