FS#49974 - [lldb] libedit 20160618_3.1 breaks input
Attached to Project:
Arch Linux
Opened by Moritz Kiefer (cocreature) - Wednesday, 06 July 2016, 18:57 GMT
Last edited by Evangelos Foutras (foutrelis) - Friday, 26 May 2017, 00:06 GMT
Opened by Moritz Kiefer (cocreature) - Wednesday, 06 July 2016, 18:57 GMT
Last edited by Evangelos Foutras (foutrelis) - Friday, 26 May 2017, 00:06 GMT
|
Details
Description:
After upgrading to [[libedit 20160618_3.1]] lldb no longer recognizes characters correctly. Instead they are shown (and handled as) weird unicode escape sequences, e.g. "\U+96272\U+96275\U+9626E" instead of "run". The exact numbers also seem to change between restarts but the last two numbers always represent the correct ascii hex code. The libedit changelog says ``` deprecate option --enable-widec. Upstream now always build with unicode (wide-char/UTF-8) support. ``` which seems like it might be related. Steps to reproduce: Install lldb 3.8 and libedit 20160618_3.1, launch lldb and try to type anything. |
This task depends upon
Closed by Evangelos Foutras (foutrelis)
Friday, 26 May 2017, 00:06 GMT
Reason for closing: Fixed
Additional comments about closing: lldb 4.0.0-3
Friday, 26 May 2017, 00:06 GMT
Reason for closing: Fixed
Additional comments about closing: lldb 4.0.0-3
Quote:
{
The NetBSD upstream for my package [..libedit..] now only build with unicode (wide-char/UTF-8) support.
So it looks like LLDB_EDITLINE_USE_WCHAR=1 should be used on Arch Linux:
https://github.com/llvm-mirror/lldb/search?utf8=%E2%9C%93&q=LLDB_EDITLINE_USE_WCHAR
}
This just agrees with Moritz Kiefer, I didn't read your message on time.
Reported to lldb:
https://llvm.org/bugs/show_bug.cgi?id=28898
I've opted to disable libedit in LLDB for now until a better solution becomes known; it's worth noting that FreeBSD has reverted their libedit version bump, quoting LLDB breakage as the reason. [1]
[1] https://svnweb.freebsd.org/base?view=revision&revision=296435
Other users preferred just to avoid updating libedit, without being exposed to the bug ftb. However the patch makes useless the above workaround and introduces a new annoying behaviour.
After replacing
"#define LLDB_EDITLINE_USE_WCHAR 0" with
"""
#define LLDB_EDITLINE_USE_WCHAR 1
#include <codecvt>
""" in "src/llvm-4.0.0.src/tools/lldb/include/lldb/Host/Editline.h", I got lldb working, including normal typing(ASCII), arrow keys, ctrl+C/ctrl+D, and there's no crashing when exiting lldb. Maybe it's due to the recent llvm update, or the libedit update. Anyway, can someone confirm this?
It's not a complete fix though, as Chinese characters and other non-ASCII latin characters are still incorrectly displayed, like "\U+6D4B\U+8BD5".