summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-06-12 21:57:23 +0200
committerMichał Górny <mgorny@gentoo.org>2017-06-12 23:27:43 +0200
commit37226cb9d3f5f595eed36b56d5fe9d9b45d41956 (patch)
treef006a7d4fcd2e6957a17e49c739557eae661e34f /dev-util/lldb
parentdev-libs/libedit: Fix building with ncurses[tinfo] (diff)
downloadgentoo-37226cb9d3f5f595eed36b56d5fe9d9b45d41956.tar.gz
gentoo-37226cb9d3f5f595eed36b56d5fe9d9b45d41956.tar.bz2
gentoo-37226cb9d3f5f595eed36b56d5fe9d9b45d41956.zip
dev-util/lldb: Fix compatibility with libedit-2017*
Diffstat (limited to 'dev-util/lldb')
-rw-r--r--dev-util/lldb/files/4.0.0/0002-Fix-bug-28898.patch98
-rw-r--r--dev-util/lldb/lldb-4.0.0-r1.ebuild (renamed from dev-util/lldb/lldb-4.0.0.ebuild)2
2 files changed, 100 insertions, 0 deletions
diff --git a/dev-util/lldb/files/4.0.0/0002-Fix-bug-28898.patch b/dev-util/lldb/files/4.0.0/0002-Fix-bug-28898.patch
new file mode 100644
index 000000000000..563d2f6813a2
--- /dev/null
+++ b/dev-util/lldb/files/4.0.0/0002-Fix-bug-28898.patch
@@ -0,0 +1,98 @@
+From 9ad9480c3a380a04b3dbe869c0675d6bba37247b Mon Sep 17 00:00:00 2001
+From: Kamil Rytarowski <n54@gmx.com>
+Date: Thu, 25 May 2017 20:12:30 +0000
+Subject: [PATCH] Fix bug #28898 lldb: libedit produces garbled, unusable input
+ on Linux
+
+Apply patch from Christos Zoulas, upstream libedit developer.
+It has been tested on NetBSD/amd64.
+
+New code supports combination of wide libedit and disabled
+LLDB_EDITLINE_USE_WCHAR, which was the popular case on Linux
+systems.
+
+
+git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@303907 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ include/lldb/Host/Editline.h | 12 +++++++++---
+ source/Host/common/Editline.cpp | 8 ++++----
+ 2 files changed, 13 insertions(+), 7 deletions(-)
+
+diff --git a/include/lldb/Host/Editline.h b/include/lldb/Host/Editline.h
+index 2b1a8e047..0b75e9c92 100644
+--- a/include/lldb/Host/Editline.h
++++ b/include/lldb/Host/Editline.h
+@@ -82,8 +82,14 @@ using EditLineStringStreamType = std::stringstream;
+ using EditLineCharType = char;
+ #endif
+
++#ifdef EL_CLIENTDATA /* editline with wide support + wide char read function */
++using EditLineGetCharType = wchar_t;
++#else
++using EditLineGetCharType = char;
++#endif
++
+ typedef int (*EditlineGetCharCallbackType)(::EditLine *editline,
+- EditLineCharType *c);
++ EditLineGetCharType *c);
+ typedef unsigned char (*EditlineCommandCallbackType)(::EditLine *editline,
+ int ch);
+ typedef const char *(*EditlinePromptCallbackType)(::EditLine *editline);
+@@ -270,7 +276,7 @@ private:
+
+ /// Character reading implementation for EditLine that supports our multi-line
+ /// editing trickery.
+- int GetCharacter(EditLineCharType *c);
++ int GetCharacter(EditLineGetCharType *c);
+
+ /// Prompt implementation for EditLine.
+ const char *Prompt();
+@@ -323,7 +329,7 @@ private:
+ /// single or multi-line editing.
+ void ConfigureEditor(bool multiline);
+
+- bool CompleteCharacter(char ch, EditLineCharType &out);
++ bool CompleteCharacter(char ch, EditLineGetCharType &out);
+
+ private:
+ #if LLDB_EDITLINE_USE_WCHAR
+diff --git a/source/Host/common/Editline.cpp b/source/Host/common/Editline.cpp
+index 7d4b398a1..7b580dde6 100644
+--- a/source/Host/common/Editline.cpp
++++ b/source/Host/common/Editline.cpp
+@@ -474,7 +474,7 @@ unsigned char Editline::RecallHistory(bool earlier) {
+ return CC_NEWLINE;
+ }
+
+-int Editline::GetCharacter(EditLineCharType *c) {
++int Editline::GetCharacter(EditLineGetCharType *c) {
+ const LineInfoW *info = el_wline(m_editline);
+
+ // Paint a faint version of the desired prompt over the version libedit draws
+@@ -969,7 +969,7 @@ void Editline::ConfigureEditor(bool multiline) {
+ }));
+
+ el_wset(m_editline, EL_GETCFN, (EditlineGetCharCallbackType)([](
+- EditLine *editline, EditLineCharType *c) {
++ EditLine *editline, EditLineGetCharType *c) {
+ return Editline::InstanceFor(editline)->GetCharacter(c);
+ }));
+
+@@ -1360,12 +1360,12 @@ void Editline::PrintAsync(Stream *stream, const char *s, size_t len) {
+ }
+ }
+
+-bool Editline::CompleteCharacter(char ch, EditLineCharType &out) {
++bool Editline::CompleteCharacter(char ch, EditLineGetCharType &out) {
+ #if !LLDB_EDITLINE_USE_WCHAR
+ if (ch == (char)EOF)
+ return false;
+
+- out = ch;
++ out = (unsigned char)ch;
+ return true;
+ #else
+ std::codecvt_utf8<wchar_t> cvt;
+--
+2.13.1
+
diff --git a/dev-util/lldb/lldb-4.0.0.ebuild b/dev-util/lldb/lldb-4.0.0-r1.ebuild
index 15acb23e9729..fac097e7f54a 100644
--- a/dev-util/lldb/lldb-4.0.0.ebuild
+++ b/dev-util/lldb/lldb-4.0.0-r1.ebuild
@@ -58,6 +58,8 @@ src_unpack() {
src_prepare() {
# fix tests in stand-alone build
eapply "${FILESDIR}"/4.0.0/0001-test-Fix-finding-LLDB-tools-when-building-stand-alon.patch
+ # fix compatibility with new libedit
+ eapply "${FILESDIR}"/4.0.0/0002-Fix-bug-28898.patch
eapply_user
}