[Lldb-commits] [PATCH] D49334: [LLDB} Added syntax highlighting support

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 25 11:55:52 PDT 2018


teemperor updated this revision to Diff 157320.
teemperor marked 8 inline comments as done.
teemperor added a comment.

- Addressed Pavel's comments. Also cleaned up some more includes.

Yes, knowing the language we currently display would be nice, but I didn't see a good way to reliably get this information. The File class doesn't know anything about the meaning of its contents. And the SourceManager can be given a SymbolContextList, but looking at the test coverage that list is often just a nullptr.

So I went with the file name matching as it doesn't have any surprising side effects (like starting to demangle symbols) or any special requirements to the caller (like already knowing the language type/symbol context of what we will display).

I think it's a reasonable fallback that should always work and we can later add functionality to pass a language to the SourceManager/File/etc., if the caller has that information available.

(Also thanks for the review).


https://reviews.llvm.org/D49334

Files:
  include/lldb/Core/Debugger.h
  include/lldb/Core/Highlighter.h
  include/lldb/Target/Language.h
  packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
  source/Core/CMakeLists.txt
  source/Core/Debugger.cpp
  source/Core/Highlighter.cpp
  source/Core/SourceManager.cpp
  source/Plugins/Language/CMakeLists.txt
  source/Plugins/Language/CPlusPlus/CMakeLists.txt
  source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
  source/Plugins/Language/ClangCommon/CMakeLists.txt
  source/Plugins/Language/ClangCommon/ClangHighlighter.cpp
  source/Plugins/Language/ClangCommon/ClangHighlighter.h
  source/Plugins/Language/Go/GoLanguage.cpp
  source/Plugins/Language/Go/GoLanguage.h
  source/Plugins/Language/Java/JavaLanguage.cpp
  source/Plugins/Language/Java/JavaLanguage.h
  source/Plugins/Language/OCaml/OCamlLanguage.cpp
  source/Plugins/Language/OCaml/OCamlLanguage.h
  source/Plugins/Language/ObjC/CMakeLists.txt
  source/Plugins/Language/ObjC/ObjCLanguage.cpp
  source/Plugins/Language/ObjC/ObjCLanguage.h
  source/Plugins/Language/ObjCPlusPlus/CMakeLists.txt
  source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp
  source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h
  source/Target/Language.cpp
  unittests/Language/CMakeLists.txt
  unittests/Language/Highlighting/CMakeLists.txt
  unittests/Language/Highlighting/HighlighterTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49334.157320.patch
Type: text/x-patch
Size: 47160 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180725/8c31b9c4/attachment-0001.bin>


More information about the lldb-commits mailing list