|
15 | 15 | #include "lldb/Breakpoint/BreakpointResolver.h" |
16 | 16 | #include "lldb/Breakpoint/BreakpointResolverFileLine.h" |
17 | 17 | #include "lldb/Core/Address.h" |
| 18 | +#include "lldb/Core/Debugger.h" |
18 | 19 | #include "lldb/Core/Module.h" |
19 | 20 | #include "lldb/Core/ModuleList.h" |
20 | 21 | #include "lldb/Core/SearchFilter.h" |
|
26 | 27 | #include "lldb/Target/SectionLoadList.h" |
27 | 28 | #include "lldb/Target/Target.h" |
28 | 29 | #include "lldb/Target/ThreadSpec.h" |
| 30 | +#include "lldb/Utility/AnsiTerminal.h" |
29 | 31 | #include "lldb/Utility/LLDBLog.h" |
30 | 32 | #include "lldb/Utility/Log.h" |
31 | 33 | #include "lldb/Utility/Stream.h" |
@@ -838,6 +840,13 @@ void Breakpoint::GetDescription(Stream *s, lldb::DescriptionLevel level, |
838 | 840 | bool show_locations) { |
839 | 841 | assert(s != nullptr); |
840 | 842 |
|
| 843 | + const bool dim_breakpoint_description = |
| 844 | + !IsEnabled() && s->AsRawOstream().colors_enabled(); |
| 845 | + if (dim_breakpoint_description) |
| 846 | + s->Printf("%s", ansi::FormatAnsiTerminalCodes( |
| 847 | + GetTarget().GetDebugger().GetDisabledAnsiPrefix()) |
| 848 | + .c_str()); |
| 849 | + |
841 | 850 | if (!m_kind_description.empty()) { |
842 | 851 | if (level == eDescriptionLevelBrief) { |
843 | 852 | s->PutCString(GetBreakpointKind()); |
@@ -934,6 +943,12 @@ void Breakpoint::GetDescription(Stream *s, lldb::DescriptionLevel level, |
934 | 943 | } |
935 | 944 | s->IndentLess(); |
936 | 945 | } |
| 946 | + |
| 947 | + // Reset the colors back to normal if they were previously greyed out. |
| 948 | + if (dim_breakpoint_description) |
| 949 | + s->Printf("%s", ansi::FormatAnsiTerminalCodes( |
| 950 | + GetTarget().GetDebugger().GetDisabledAnsiSuffix()) |
| 951 | + .c_str()); |
937 | 952 | } |
938 | 953 |
|
939 | 954 | void Breakpoint::GetResolverDescription(Stream *s) { |
|
0 commit comments