summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/source-manager
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2018-08-30 00:09:21 +0000
committerRaphael Isemann <teemperor@gmail.com>2018-08-30 00:09:21 +0000
commit207863261ca5466bf529bbd13ba0502a649e00d0 (patch)
tree3783a4456fc7e4c92119dc71f0f66ef2f4cc6848 /lldb/packages/Python/lldbsuite/test/source-manager
parentdb92a4a83944d3999497ec7b97e5f4e0947cf267 (diff)
downloadbcm5719-llvm-207863261ca5466bf529bbd13ba0502a649e00d0.tar.gz
bcm5719-llvm-207863261ca5466bf529bbd13ba0502a649e00d0.zip
Move the column marking functionality to the Highlighter framework
Summary: 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} {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. Reviewers: aprantl Reviewed By: aprantl Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D51466 llvm-svn: 341003
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/source-manager')
-rw-r--r--lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py b/lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
index dc43cd0815a..ea822decdb6 100644
--- a/lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
+++ b/lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
@@ -113,7 +113,7 @@ class SourceManagerTestCase(TestBase):
"""Test display of source using the SBSourceManager API, using a
dumb terminal and thus no color support (the default)."""
use_color = True
- underline_regex = ansi_underline_surround_regex(r".")
+ underline_regex = ansi_underline_surround_regex(r"printf")
self.do_display_source_python_api(use_color, underline_regex)
@add_test_categories(['pyapi'])
@@ -132,7 +132,8 @@ class SourceManagerTestCase(TestBase):
self.do_display_source_python_api(use_color, color_regex, syntax_highlighting)
# Test that we didn't color unrelated identifiers.
- self.do_display_source_python_api(use_color, r" printf\(", syntax_highlighting)
+ self.do_display_source_python_api(use_color, r" main\(", syntax_highlighting)
+ self.do_display_source_python_api(use_color, r"\);", syntax_highlighting)
def test_move_and_then_display_source(self):
"""Test that target.source-map settings work by moving main.c to hidden/main.c."""
OpenPOWER on IntegriCloud