[LLDB] Added syntax highlighting support
authorRaphael Isemann <teemperor@gmail.com>
Thu, 2 Aug 2018 00:30:15 +0000 (00:30 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Thu, 2 Aug 2018 00:30:15 +0000 (00:30 +0000)
commit566afa0ab2ce3fc753ce7490f7c1394c3f4699c0
tree4295653b2b9482af2a8f0cbcd7cc90ad7fd54147
parentcedebd594083a54cfb0a0b766fd000b6f11216fa
[LLDB] Added syntax highlighting support

Summary:
This patch adds syntax highlighting support to LLDB. When enabled (and lldb is allowed
to use colors), printed source code is annotated with the ANSI color escape sequences.

So far we have only one highlighter which is based on Clang and is responsible for all
languages that are supported by Clang. It essentially just runs the raw lexer over the input
and then surrounds the specific tokens with the configured escape sequences.

Reviewers: zturner, davide

Reviewed By: davide

Subscribers: labath, teemperor, llvm-commits, mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D49334

llvm-svn: 338662
31 files changed:
lldb/include/lldb/Core/Debugger.h
lldb/include/lldb/Core/Highlighter.h [new file with mode: 0644]
lldb/include/lldb/Target/Language.h
lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
lldb/source/Core/CMakeLists.txt
lldb/source/Core/Debugger.cpp
lldb/source/Core/Highlighter.cpp [new file with mode: 0644]
lldb/source/Core/SourceManager.cpp
lldb/source/Plugins/Language/CMakeLists.txt
lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt
lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
lldb/source/Plugins/Language/ClangCommon/CMakeLists.txt [new file with mode: 0644]
lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp [new file with mode: 0644]
lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.h [new file with mode: 0644]
lldb/source/Plugins/Language/Go/GoLanguage.cpp
lldb/source/Plugins/Language/Go/GoLanguage.h
lldb/source/Plugins/Language/Java/JavaLanguage.cpp
lldb/source/Plugins/Language/Java/JavaLanguage.h
lldb/source/Plugins/Language/OCaml/OCamlLanguage.cpp
lldb/source/Plugins/Language/OCaml/OCamlLanguage.h
lldb/source/Plugins/Language/ObjC/CMakeLists.txt
lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp
lldb/source/Plugins/Language/ObjC/ObjCLanguage.h
lldb/source/Plugins/Language/ObjCPlusPlus/CMakeLists.txt
lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp
lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h
lldb/source/Target/Language.cpp
lldb/unittests/Language/CMakeLists.txt
lldb/unittests/Language/Highlighting/CMakeLists.txt [new file with mode: 0644]
lldb/unittests/Language/Highlighting/HighlighterTest.cpp [new file with mode: 0644]