public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-util/lldb/files/4.0.0/, dev-util/lldb/
@ 2017-06-12 21:27 Michał Górny
  0 siblings, 0 replies; only message in thread
From: Michał Górny @ 2017-06-12 21:27 UTC (permalink / raw
  To: gentoo-commits

commit:     37226cb9d3f5f595eed36b56d5fe9d9b45d41956
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 12 19:57:23 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jun 12 21:27:43 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=37226cb9

dev-util/lldb: Fix compatibility with libedit-2017*

 dev-util/lldb/files/4.0.0/0002-Fix-bug-28898.patch | 98 ++++++++++++++++++++++
 .../{lldb-4.0.0.ebuild => lldb-4.0.0-r1.ebuild}    |  2 +
 2 files changed, 100 insertions(+)

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 00000000000..563d2f6813a
--- /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
similarity index 97%
rename from dev-util/lldb/lldb-4.0.0.ebuild
rename to dev-util/lldb/lldb-4.0.0-r1.ebuild
index 15acb23e972..fac097e7f54 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
 }


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-12 21:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-12 21:27 [gentoo-commits] repo/gentoo:master commit in: dev-util/lldb/files/4.0.0/, dev-util/lldb/ Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox