[Lldb-commits] [PATCH] D49334: [LLDB} Added syntax highlighting support
Raphael Isemann via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Jul 24 09:28:57 PDT 2018
teemperor updated this revision to Diff 157054.
teemperor added a comment.
[Updated patch to address Pavel's comments, thanks!]
@zturner So I looked into the Windows support:
Windows requires us to directly flush/signal/write/flush to the console output stream. However lldb's output is buffered by design into a StreamString first to prevent overlapping with the process output. So we can't just add Windows support to the coloring backend as we don't have direct access to the output stream.
If we want to fix this in lldb, then we could write an ANSI color code interpreter and let that run over our final output while we print it. That wouldn't be too complex and would fix all existing coloring output in lldb. It would also fix that lldb configs that enable color support on Windows are broken (because people just add color codes there).
However, it seems Windows starting with https://reviews.llvm.org/W10 anyway supports ANSI color codes (or at least you can enable them in the settings). So that interpreter is only really necessary until everyone moved to a version that supports color codes: https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#span-idtextformattingspanspan-idtextformattingspanspan-idtextformattingspantext-formatting
So I would suggest we maybe just hack in the color interpreter and drop it when https://reviews.llvm.org/W7 reaches EoL (?). I can make another patch for that if it sounds good.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 57232 bytes
Desc: not available
More information about the lldb-commits