[Lldb-commits] [PATCH] D51466: Move the column marking functionality to the Highlighter framework

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 29 16:05:38 PDT 2018


teemperor created this revision.
teemperor added a reviewer: aprantl.
Herald added a subscriber: lldb-commits.

The syntax highlighting feature so far is mutually exclusive with the lldb feature
that marks the current column in the line by underlining it via an ANSI color code.
Meaning that if you enable one, the other is automatically disabled by LLDB.

This was caused by the fact that both features inserted color codes into the the
source code and were likely to interfere with each other (which would result
in a broken source code printout to the user).

This patch moves the cursor code into the highlighting framework, which provides
the same feature to the user in normal non-C source code. For any source code
that is highlighted by Clang, we now also have cursor marking for the whole token
that is under the current source location. E.g., before we underlined only the '!' in the
expression '1 != 2', but now the whole token '!=' is underlined. The same for function
calls and so on. Below you can see two examples where we before only underlined
the first character of the token, but now underline the whole token.

F7075400: Screen Shot 2018-08-29 at 3.56.41 PM.png <https://reviews.llvm.org/F7075400>
F7075414: Screen Shot 2018-08-29 at 4.00.28 PM.png <https://reviews.llvm.org/F7075414>

It also simplifies the DisplaySourceLines method in the SourceManager as most of
the code in there was essentially just for getting this column marker to work as
a FormatEntity.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D51466

Files:
  include/lldb/Core/Debugger.h
  include/lldb/Core/Highlighter.h
  include/lldb/Core/SourceManager.h
  packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
  source/Core/Debugger.cpp
  source/Core/Highlighter.cpp
  source/Core/SourceManager.cpp
  source/Plugins/Language/ClangCommon/ClangHighlighter.cpp
  source/Plugins/Language/ClangCommon/ClangHighlighter.h
  unittests/Language/Highlighting/HighlighterTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51466.163216.patch
Type: text/x-patch
Size: 23501 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180829/9b3bc266/attachment-0001.bin>


More information about the lldb-commits mailing list