diff options
-rw-r--r-- | lldb/source/CMakeLists.txt | 11 | ||||
-rw-r--r-- | lldb/source/Core/IOHandler.cpp | 11 | ||||
-rw-r--r-- | lldb/source/Host/CMakeLists.txt | 8 | ||||
-rw-r--r-- | lldb/source/Host/common/Editline.cpp | 4 |
4 files changed, 23 insertions, 11 deletions
diff --git a/lldb/source/CMakeLists.txt b/lldb/source/CMakeLists.txt index 5e2ac8b9cd5..d551ebbe688 100644 --- a/lldb/source/CMakeLists.txt +++ b/lldb/source/CMakeLists.txt @@ -1,5 +1,16 @@ include_directories(.) +if (__ANDROID_NDK__ OR (CMAKE_SYSTEM_NAME MATCHES "Windows")) + set(LLDB_DEFAULT_DISABLE_LIBEDIT 1) +else() + set(LLDB_DEFAULT_DISABLE_LIBEDIT 0) +endif () + +set(LLDB_DISABLE_LIBEDIT ${LLDB_DEFAULT_DISABLE_LIBEDIT} CACHE BOOL "Disables the use of editline.") +if (LLDB_DISABLE_LIBEDIT) + add_definitions( -DLLDB_DISABLE_LIBEDIT ) +endif() + if ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) include_directories( Plugins/Process/Linux diff --git a/lldb/source/Core/IOHandler.cpp b/lldb/source/Core/IOHandler.cpp index bf3815bf1bb..21ba965ba21 100644 --- a/lldb/source/Core/IOHandler.cpp +++ b/lldb/source/Core/IOHandler.cpp @@ -387,12 +387,7 @@ IOHandlerEditline::IOHandlerEditline (Debugger &debugger, #ifndef LLDB_DISABLE_LIBEDIT bool use_editline = false; -#ifndef _MSC_VER use_editline = m_input_sp->GetFile().GetIsRealTerminal(); -#else - // Editline is causing issues on Windows, so use the fallback. - use_editline = false; -#endif if (use_editline) { @@ -620,9 +615,11 @@ IOHandlerEditline::SetContinuationPrompt (const char *p) m_continuation_prompt = p; else m_continuation_prompt.clear(); - + +#ifndef LLDB_DISABLE_LIBEDIT if (m_editline_ap) m_editline_ap->SetContinuationPrompt (m_continuation_prompt.empty() ? NULL : m_continuation_prompt.c_str()); +#endif } @@ -635,7 +632,7 @@ IOHandlerEditline::SetBaseLineNumber (uint32_t line) uint32_t IOHandlerEditline::GetCurrentLineIndex () const { -#ifdef LLDB_DISABLE_LIBEDIT +#ifndef LLDB_DISABLE_LIBEDIT if (m_editline_ap) return m_editline_ap->GetCurrentLine(); #endif diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt index e77b535b796..50f575925cb 100644 --- a/lldb/source/Host/CMakeLists.txt +++ b/lldb/source/Host/CMakeLists.txt @@ -32,10 +32,10 @@ add_host_subdirectory(common common/TimeValue.cpp ) -if (NOT __ANDROID_NDK__) -add_host_subdirectory(common - common/Editline.cpp - ) +if (NOT LLDB_DISABLE_LIBEDIT) + add_host_subdirectory(common + common/Editline.cpp + ) endif() add_host_subdirectory(posix diff --git a/lldb/source/Host/common/Editline.cpp b/lldb/source/Host/common/Editline.cpp index 215f06fe7c4..b82fbea90c6 100644 --- a/lldb/source/Host/common/Editline.cpp +++ b/lldb/source/Host/common/Editline.cpp @@ -136,6 +136,10 @@ GetIndentation (const EditLineStringType & line) bool IsInputPending (FILE * file) { + // FIXME: This will be broken on Windows if we ever re-enable Editline. You can't use select + // on something that isn't a socket. This will have to be re-written to not use a FILE*, but + // instead use some kind of yet-to-be-created abstraction that select-like functionality on + // non-socket objects. const int fd = fileno (file); fd_set fds; FD_ZERO (&fds); |