[Lldb-commits] [PATCH] D71251: [lldb] Actually enabled wchar support in Editline when it is defined in the host config
Raphael Isemann via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Dec 10 04:03:14 PST 2019
teemperor created this revision.
teemperor added a reviewer: labath.
Herald added subscribers: lldb-commits, JDevlieghere.
Herald added a project: LLDB.
teemperor added a comment.
If anyone wants to test this pre-commit, that would be appreciated as I fear we'll find some Editline implementations that will freak out over this patch. I tested this on Arch Linux and macOS.
Our Editline implementation in LLDB supports using the wchar interface of Editline which
should improve handling of unicode input when using Editline. At the moment we essentially
just ignore it and print the escaped unicode code point to the command line (which we then
also incorrectly treat as multiple characters, so console navigation is also broken afterwards).
This patch just adds the include to the host config file which already contains the LLDB_EDITLINE_USE_WCHAR
define to enable the Editline support (we just never included it in the file before).
Also adds a test that the unicode we put into Editline actually ends up being interpreted as unicode
and not just ends up being ignored in Editline.
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+Test unicode handling in LLDB.
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.lldbpexpect import PExpectTest
+ mydir = TestBase.compute_mydir(__file__)
+ # PExpect uses many timeouts internally and doesn't play well
+ # under ASAN on a loaded machine..
+ def test_unicode_input(self):
+ # Pass in some unicode that should be read correctly.
+ # We should get out that this is an invalid command with our character as UTF-8.
+ self.child.expect(u"error: '\u1234' is not a valid command.".encode('utf-8'))
@@ -32,6 +32,8 @@
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1392 bytes
Desc: not available
More information about the lldb-commits