We had run into the same issue with editline.
You can try using this patch to fix the issue with the editline versions.
Thanks,
Deepak
On 05/02/14 05:47, Todd Fiala wrote:
I just had a look at this build bot:
lldb-x86_64-linux
The latest build I looked at here
<http://lab.llvm.org:8011/builders/lldb-x86_64-linux/builds/10087>
appears to be failing because it doesn't have libedit installed. As
we mentioned above, it will need a newer libedit since we are
currently using features that don't appear to be in older versions of
the library and we're not doing anything to distinguish that at the
moment.
On Tue, Feb 4, 2014 at 4:50 PM, Todd Fiala <[email protected]
<mailto:[email protected]>> wrote:
> configure ../llvm --enable-cxx11
--with-extra-option=-I$LIBEDIT_PATH/include
--with-extra-ld-options=-L$
That should be:
../llvm/configure --enable-cxx11
--with-extra-option=-I$LIBEDIT_PATH/include
--with-extra-ld-options=-L$LIBEDIT_PATH/lib
--prefix=<some_install_path>
On Tue, Feb 4, 2014 at 4:49 PM, Todd Fiala <[email protected]
<mailto:[email protected]>> wrote:
We've been using a configure-built libedit from here
<http://thrysoee.dk/editline/>. We essentially build that
with something like "configure
--prefix=/usr/local/libedit/libedit-20130712-3.1
<tel:20130712-3.1> && make && sudo make install".
We then run configure something like this:
export LIBEDIT_PATH=/usr/local/libedit/libedit-20130712-3.1
<tel:20130712-3.1>
export
LD_LIBRARY_PATH=<some_paths_to_gcc_4.8.2/lib64>:$LIBEDIT_PATH/lib:$LD_LIBRARY_PATH
# assume ../llvm is the source tree: i.e. we're in a build
directory that parallels the source tree
configure ../llvm --enable-cxx11
--with-extra-option=-I$LIBEDIT_PATH/include
--with-extra-ld-options=-L$LIBEDIT_PATH/lib
--prefix=<some_install_path>
That's what we're doing now. We could consider breaking out
the libedit parts to the 2008-libedit spec and adding
configure/cmake checks for it. That might be a nice smallish
project for somebody to knock out.
On Tue, Feb 4, 2014 at 4:21 PM, Adam Strzelecki <[email protected]
<mailto:[email protected]>> wrote:
> I've not been looking at the linux one. However, I am
in the process of fixing something in llvm that is broken
due to unexpected interactions between libedit, libbsd and
<bsd/stdlib.h> on Ubuntu (and probably other linux
variants that might implement libedit in terms of libbsd).
The problem here is that any Ubuntu < 13.10 (which
unfortunately includes 12.04 LTS we are using) use libedit
2.11-20080614 while latest lldb
source/Host/common/Editline.cpp relies on libedit 3.1 API
(available only for 13.10).
I presume that Ubuntu < 13.10 builds should use their own
libedit 3.1 probably linked statically, but I have
absolutely no idea how to configure that.
Currently my build here fails:
/home/ono/Projects/llvm/tools/lldb/source/Host/common/Editline.cpp:70:27:
error: use of undeclared identifier 'EL_PROMPT_ESC'
::el_set (m_editline, EL_PROMPT_ESC,
GetPromptCallback, k_prompt_escape_char);
^
/home/ono/Projects/llvm/tools/lldb/source/Host/common/Editline.cpp:265:31:
error: cannot initialize a parameter of type 'char *' with
an rvalue of type 'const char *'
::el_push(m_editline, std::string (bytes,
len).c_str());
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/histedit.h:95:34: note: passing argument to
parameter here
void el_push(EditLine *, char *);
^
/home/ono/Projects/llvm/tools/lldb/source/Host/common/Editline.cpp:341:52:
error: cannot initialize a parameter of type 'char *' with
an rvalue of type 'const char *'
::el_push (m_editline,
lines[line_idx+1].c_str());
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/histedit.h:95:34: note: passing argument to
parameter here
void el_push(EditLine *, char *);
^
/home/ono/Projects/llvm/tools/lldb/source/Host/common/Editline.cpp:357:52:
error: cannot initialize a parameter of type 'char *' with
an rvalue of type 'const char *'
::el_push (m_editline,
lines[line_idx-1].c_str());
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/histedit.h:95:34: note: passing argument to
parameter here
void el_push(EditLine *, char *);
^
/home/ono/Projects/llvm/tools/lldb/source/Host/common/Editline.cpp:367:48:
error: cannot initialize a parameter of type 'char *' with
an rvalue of type 'const char *'
::el_push (m_editline,
lines[line_idx+1].c_str());
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/histedit.h:95:34: note: passing argument to
parameter here
void el_push(EditLine *, char *);
^
5 errors generated.
Cheers,
--
Adam
--
Todd Fiala | Software Engineer | [email protected]
<mailto:[email protected]> | 650-943-3180
--
Todd Fiala | Software Engineer | [email protected]
<mailto:[email protected]> | 650-943-3180
--
Todd Fiala | Software Engineer | [email protected]
<mailto:[email protected]> | 650-943-3180
_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
diff --git include/lldb/Host/Editline.h include/lldb/Host/Editline.h
index b92de10..ab7e561 100644
--- include/lldb/Host/Editline.h
+++ include/lldb/Host/Editline.h
@@ -20,6 +20,11 @@
#include <histedit.h>
#endif
+// Fix for missing Editline ver 1.5
+#ifndef EL_PROMPT_ESC
+#define EL_PROMPT_ESC 21
+#endif
+
#include <string>
#include <vector>
diff --git source/Host/common/Editline.cpp source/Host/common/Editline.cpp
index 7e6a2f5..c7c169e 100644
--- source/Host/common/Editline.cpp
+++ source/Host/common/Editline.cpp
@@ -262,7 +262,7 @@ Editline::Push (const char *bytes, size_t len)
{
// Must NULL terminate the string for el_push() so we stick it
// into a std::string first
- ::el_push(m_editline, std::string (bytes, len).c_str());
+ ::el_push(m_editline, (char*)std::string (bytes, len).c_str());
return len;
}
return 0;
@@ -338,7 +338,10 @@ Editline::GetLines(const std::string &end_line, StringList
&lines)
// we were editing previous lines, then populate the
line
// with the appropriate contents
if (line_idx+1 < lines.GetSize() &&
!lines[line_idx+1].empty())
- ::el_push (m_editline, lines[line_idx+1].c_str());
+ {
+ std::string &str = lines[line_idx+1];
+ Push(str.c_str(), str.length());
+ }
}
else if (line_status == LineStatus::Error)
{
@@ -354,7 +357,10 @@ Editline::GetLines(const std::string &end_line, StringList
&lines)
//::fprintf (out_file, "\033[1A\033[%uD\033[2K",
(uint32_t)(m_lines_prompt.size() + lines[line_idx].size())); // Make cursor go
up a line and clear that line
::fprintf (out_file, "\033[1A\033[1000D\033[2K");
if (!lines[line_idx-1].empty())
- ::el_push (m_editline, lines[line_idx-1].c_str());
+ {
+ std::string &str = lines[line_idx-1];
+ Push(str.c_str(), str.length());
+ }
--m_lines_curr_line;
}
break;
@@ -364,7 +370,10 @@ Editline::GetLines(const std::string &end_line, StringList
&lines)
//::fprintf (out_file, "\033[1B\033[%uD\033[2K",
(uint32_t)(m_lines_prompt.size() + lines[line_idx].size()));
::fprintf (out_file, "\033[1B\033[1000D\033[2K");
if (line_idx+1 < lines.GetSize() &&
!lines[line_idx+1].empty())
- ::el_push (m_editline, lines[line_idx+1].c_str());
+ {
+ std::string &str = lines[line_idx+1];
+ Push(str.c_str(), str.length());
+ }
break;
}
}
_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev