This matches the naming scheme used by LLVM.
Differential revision: https://reviews.llvm.org/D71380
endif()
set(default_disable_python OFF)
-set(default_disable_libedit OFF)
+set(default_enable_libedit ON)
set(default_enable_curses ON)
if(DEFINED LLVM_ENABLE_LIBEDIT AND NOT LLVM_ENABLE_LIBEDIT)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
- set(default_disable_libedit ON)
+ set(default_enable_libedit OFF)
set(default_enable_curses OFF)
elseif(CMAKE_SYSTEM_NAME MATCHES "Android")
set(default_disable_python ON)
- set(default_disable_libedit ON)
+ set(default_enable_libedit OFF)
set(default_enable_curses OFF)
elseif(IOS)
set(default_disable_python ON)
endif()
option(LLDB_DISABLE_PYTHON "Disable Python scripting integration." ${default_disable_python})
-option(LLDB_DISABLE_LIBEDIT "Disable the use of editline." ${default_disable_libedit})
+option(LLDB_ENABLE_LIBEDIT "Disable the use of editline." ${default_enable_libedit})
option(LLDB_ENABLE_CURSES "Disable Curses integration." ${default_enable_curses})
option(LLDB_RELOCATABLE_PYTHON "Use the PYTHONHOME environment variable to locate Python." OFF)
option(LLDB_USE_SYSTEM_SIX "Use six.py shipped with system and do not install a copy of it" OFF)
endif()
-if (NOT LLDB_DISABLE_LIBEDIT)
+if (LLDB_ENABLE_LIBEDIT)
find_package(LibEdit REQUIRED)
# Check if we libedit capable of handling wide characters (built with
::
- -DLLDB_DISABLE_LIBEDIT=1
-DLLDB_DISABLE_PYTHON=1
+ -DLLDB_ENABLE_LIBEDIT=0
-DLLDB_ENABLE_CURSES=0
-DLLVM_ENABLE_TERMINFO=0
-DLLVM_TABLEGEN=<path-to-host>/bin/llvm-tblgen \
-DCLANG_TABLEGEN=<path-to-host>/bin/clang-tblgen \
-DLLDB_DISABLE_PYTHON=1 \
- -DLLDB_DISABLE_LIBEDIT=1 \
+ -DLLDB_ENABLE_LIBEDIT=0 \
-DLLDB_ENABLE_CURSES=0
An alternative (and recommended) way to compile LLDB is with clang.
void PrintAsync(Stream *stream, const char *s, size_t len) override;
private:
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
static bool IsInputCompleteCallback(Editline *editline, StringList &lines,
void *baton);
#endif
protected:
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
std::unique_ptr<Editline> m_editline_up;
#endif
IOHandlerDelegate &m_delegate;
#cmakedefine01 LLDB_ENABLE_CURSES
-#cmakedefine LLDB_ENABLE_LIBXML2
+#cmakedefine01 LLDB_ENABLE_LIBEDIT
-#cmakedefine LLDB_DISABLE_LIBEDIT
+#cmakedefine LLDB_ENABLE_LIBXML2
#cmakedefine LLDB_DISABLE_PYTHON
# TODO: Remove once we have better layering
set_target_properties(lldbCore PROPERTIES LINK_INTERFACE_MULTIPLICITY 4)
-if (NOT LLDB_DISABLE_LIBEDIT)
+if (LLDB_ENABLE_LIBEDIT)
target_include_directories(lldbCore PRIVATE ${libedit_INCLUDE_DIRS})
endif()
#include "lldb/Utility/StringList.h"
#include "lldb/lldb-forward.h"
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
#include "lldb/Host/Editline.h"
#endif
#include "lldb/Interpreter/CommandCompletions.h"
IOHandlerDelegate &delegate, repro::DataRecorder *data_recorder)
: IOHandler(debugger, type, input_sp, output_sp, error_sp, flags,
data_recorder),
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
m_editline_up(),
#endif
m_delegate(delegate), m_prompt(), m_continuation_prompt(),
m_editing(false) {
SetPrompt(prompt);
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
bool use_editline = false;
use_editline = GetInputFILE() && GetOutputFILE() && GetErrorFILE() &&
}
IOHandlerEditline::~IOHandlerEditline() {
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
m_editline_up.reset();
#endif
}
}
bool IOHandlerEditline::GetLine(std::string &line, bool &interrupted) {
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
if (m_editline_up) {
bool b = m_editline_up->GetLine(line, interrupted);
if (b && m_data_recorder)
return (bool)got_line;
}
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
bool IOHandlerEditline::IsInputCompleteCallback(Editline *editline,
StringList &lines,
void *baton) {
#endif
const char *IOHandlerEditline::GetPrompt() {
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
if (m_editline_up) {
return m_editline_up->GetPrompt();
} else {
#endif
if (m_prompt.empty())
return nullptr;
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
}
#endif
return m_prompt.c_str();
bool IOHandlerEditline::SetPrompt(llvm::StringRef prompt) {
m_prompt = prompt;
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
if (m_editline_up)
m_editline_up->SetPrompt(m_prompt.empty() ? nullptr : m_prompt.c_str());
#endif
void IOHandlerEditline::SetContinuationPrompt(llvm::StringRef prompt) {
m_continuation_prompt = prompt;
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
if (m_editline_up)
m_editline_up->SetContinuationPrompt(m_continuation_prompt.empty()
? nullptr
}
uint32_t IOHandlerEditline::GetCurrentLineIndex() const {
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
if (m_editline_up)
return m_editline_up->GetCurrentLine();
#endif
m_current_lines_ptr = &lines;
bool success = false;
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
if (m_editline_up) {
return m_editline_up->GetLines(m_base_line_number, lines, interrupted);
} else {
}
}
success = lines.GetSize() > 0;
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
}
#endif
return success;
}
void IOHandlerEditline::Cancel() {
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
if (m_editline_up)
m_editline_up->Cancel();
#endif
if (m_delegate.IOHandlerInterrupt(*this))
return true;
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
if (m_editline_up)
return m_editline_up->Interrupt();
#endif
}
void IOHandlerEditline::GotEOF() {
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
if (m_editline_up)
m_editline_up->Interrupt();
#endif
}
void IOHandlerEditline::PrintAsync(Stream *stream, const char *s, size_t len) {
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
if (m_editline_up)
m_editline_up->PrintAsync(stream, s, len);
else
common/XML.cpp
)
-if (NOT LLDB_DISABLE_LIBEDIT)
+if (LLDB_ENABLE_LIBEDIT)
add_host_subdirectory(common
common/Editline.cpp
)
if (HAVE_LIBDL)
list(APPEND EXTRA_LIBS ${CMAKE_DL_LIBS})
endif()
-if (NOT LLDB_DISABLE_LIBEDIT)
+if (LLDB_ENABLE_LIBEDIT)
list(APPEND EXTRA_LIBS ${libedit_LIBRARIES})
endif()
if (LLDB_ENABLE_LZMA)
list(APPEND EXTRA_LIBS ${LIBLZMA_LIBRARIES})
endif()
-if (NOT LLDB_DISABLE_LIBEDIT)
+if (LLDB_ENABLE_LIBEDIT)
list(APPEND LLDB_LIBEDIT_LIBS ${libedit_LIBRARIES})
if (LLVM_BUILD_STATIC)
list(APPEND LLDB_SYSTEM_LIBS gpm)
Support
)
-if (NOT LLDB_DISABLE_LIBEDIT)
+if (LLDB_ENABLE_LIBEDIT)
target_include_directories(lldbHost PUBLIC ${libedit_INCLUDE_DIRS})
endif()
LLDBInterpreterPropertiesGen
LLDBInterpreterPropertiesEnumGen)
-if (NOT LLDB_DISABLE_LIBEDIT)
+if (LLDB_ENABLE_LIBEDIT)
target_include_directories(lldbInterpreter PRIVATE ${libedit_INCLUDE_DIRS})
endif()
#include "lldb/Utility/Timer.h"
#include "lldb/Host/Config.h"
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
#include "lldb/Host/Editline.h"
#endif
#include "lldb/Host/Host.h"
endif()
add_definitions(-DLLDB_PYTHON_RELATIVE_LIBDIR="${LLDB_PYTHON_RELATIVE_PATH}")
-if (NOT LLDB_DISABLE_LIBEDIT)
+if (LLDB_ENABLE_LIBEDIT)
list(APPEND LLDB_LIBEDIT_LIBS ${libedit_LIBRARIES})
endif()
Support
)
-if (NOT LLDB_DISABLE_LIBEDIT)
+if (LLDB_ENABLE_LIBEDIT)
target_include_directories(lldbPluginScriptInterpreterPython PUBLIC
${libedit_INCLUDE_DIRS}
)
#ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONREADLINE_H
#define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONREADLINE_H
-#if !defined(LLDB_DISABLE_LIBEDIT) && defined(__linux__)
+#if LLDB_ENABLE_LIBEDIT && defined(__linux__)
// NOTE: Since Python may define some pre-processor definitions which affect the
// standard headers on some systems, you must include Python.h before any
// standard headers are included.
#include "lldb/Host/Config.h"
-#ifndef LLDB_DISABLE_LIBEDIT
+#if LLDB_ENABLE_LIBEDIT
#define EDITLINE_TEST_DUMP_OUTPUT 0