[lldb/CMake] Rename LLDB_DISABLE_LIBEDIT to LLDB_ENABLE_LIBEDIT

This matches the naming scheme used by LLVM.

Differential revision: https://reviews.llvm.org/D71380
This commit is contained in:
Jonas Devlieghere 2019-12-12 09:22:34 -08:00
parent bd12a322d7
commit 62456e579e
12 changed files with 39 additions and 39 deletions

View File

@ -25,7 +25,7 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darw
endif() endif()
set(default_disable_python OFF) set(default_disable_python OFF)
set(default_disable_libedit OFF) set(default_enable_libedit ON)
set(default_enable_curses ON) set(default_enable_curses ON)
if(DEFINED LLVM_ENABLE_LIBEDIT AND NOT LLVM_ENABLE_LIBEDIT) if(DEFINED LLVM_ENABLE_LIBEDIT AND NOT LLVM_ENABLE_LIBEDIT)
@ -33,18 +33,18 @@ if(DEFINED LLVM_ENABLE_LIBEDIT AND NOT LLVM_ENABLE_LIBEDIT)
endif() endif()
if(CMAKE_SYSTEM_NAME MATCHES "Windows") if(CMAKE_SYSTEM_NAME MATCHES "Windows")
set(default_disable_libedit ON) set(default_enable_libedit OFF)
set(default_enable_curses OFF) set(default_enable_curses OFF)
elseif(CMAKE_SYSTEM_NAME MATCHES "Android") elseif(CMAKE_SYSTEM_NAME MATCHES "Android")
set(default_disable_python ON) set(default_disable_python ON)
set(default_disable_libedit ON) set(default_enable_libedit OFF)
set(default_enable_curses OFF) set(default_enable_curses OFF)
elseif(IOS) elseif(IOS)
set(default_disable_python ON) set(default_disable_python ON)
endif() endif()
option(LLDB_DISABLE_PYTHON "Disable Python scripting integration." ${default_disable_python}) 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_ENABLE_CURSES "Disable Curses integration." ${default_enable_curses})
option(LLDB_RELOCATABLE_PYTHON "Use the PYTHONHOME environment variable to locate Python." OFF) 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) option(LLDB_USE_SYSTEM_SIX "Use six.py shipped with system and do not install a copy of it" OFF)
@ -109,7 +109,7 @@ if ((NOT MSVC) OR MSVC12)
endif() endif()
if (NOT LLDB_DISABLE_LIBEDIT) if (LLDB_ENABLE_LIBEDIT)
find_package(LibEdit REQUIRED) find_package(LibEdit REQUIRED)
# Check if we libedit capable of handling wide characters (built with # Check if we libedit capable of handling wide characters (built with

View File

@ -401,8 +401,8 @@ further by passing the appropriate cmake options, such as:
:: ::
-DLLDB_DISABLE_LIBEDIT=1
-DLLDB_DISABLE_PYTHON=1 -DLLDB_DISABLE_PYTHON=1
-DLLDB_ENABLE_LIBEDIT=0
-DLLDB_ENABLE_CURSES=0 -DLLDB_ENABLE_CURSES=0
-DLLVM_ENABLE_TERMINFO=0 -DLLVM_ENABLE_TERMINFO=0
@ -454,7 +454,7 @@ to prepare the cmake build with the following parameters:
-DLLVM_TABLEGEN=<path-to-host>/bin/llvm-tblgen \ -DLLVM_TABLEGEN=<path-to-host>/bin/llvm-tblgen \
-DCLANG_TABLEGEN=<path-to-host>/bin/clang-tblgen \ -DCLANG_TABLEGEN=<path-to-host>/bin/clang-tblgen \
-DLLDB_DISABLE_PYTHON=1 \ -DLLDB_DISABLE_PYTHON=1 \
-DLLDB_DISABLE_LIBEDIT=1 \ -DLLDB_ENABLE_LIBEDIT=0 \
-DLLDB_ENABLE_CURSES=0 -DLLDB_ENABLE_CURSES=0
An alternative (and recommended) way to compile LLDB is with clang. An alternative (and recommended) way to compile LLDB is with clang.

View File

@ -407,7 +407,7 @@ public:
void PrintAsync(Stream *stream, const char *s, size_t len) override; void PrintAsync(Stream *stream, const char *s, size_t len) override;
private: private:
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
static bool IsInputCompleteCallback(Editline *editline, StringList &lines, static bool IsInputCompleteCallback(Editline *editline, StringList &lines,
void *baton); void *baton);
@ -418,7 +418,7 @@ private:
#endif #endif
protected: protected:
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
std::unique_ptr<Editline> m_editline_up; std::unique_ptr<Editline> m_editline_up;
#endif #endif
IOHandlerDelegate &m_delegate; IOHandlerDelegate &m_delegate;

View File

@ -37,9 +37,9 @@
#cmakedefine01 LLDB_ENABLE_CURSES #cmakedefine01 LLDB_ENABLE_CURSES
#cmakedefine LLDB_ENABLE_LIBXML2 #cmakedefine01 LLDB_ENABLE_LIBEDIT
#cmakedefine LLDB_DISABLE_LIBEDIT #cmakedefine LLDB_ENABLE_LIBXML2
#cmakedefine LLDB_DISABLE_PYTHON #cmakedefine LLDB_DISABLE_PYTHON

View File

@ -98,7 +98,7 @@ add_dependencies(lldbCore
# TODO: Remove once we have better layering # TODO: Remove once we have better layering
set_target_properties(lldbCore PROPERTIES LINK_INTERFACE_MULTIPLICITY 4) 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}) target_include_directories(lldbCore PRIVATE ${libedit_INCLUDE_DIRS})
endif() endif()

View File

@ -22,7 +22,7 @@
#include "lldb/Utility/StringList.h" #include "lldb/Utility/StringList.h"
#include "lldb/lldb-forward.h" #include "lldb/lldb-forward.h"
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
#include "lldb/Host/Editline.h" #include "lldb/Host/Editline.h"
#endif #endif
#include "lldb/Interpreter/CommandCompletions.h" #include "lldb/Interpreter/CommandCompletions.h"
@ -234,7 +234,7 @@ IOHandlerEditline::IOHandlerEditline(
IOHandlerDelegate &delegate, repro::DataRecorder *data_recorder) IOHandlerDelegate &delegate, repro::DataRecorder *data_recorder)
: IOHandler(debugger, type, input_sp, output_sp, error_sp, flags, : IOHandler(debugger, type, input_sp, output_sp, error_sp, flags,
data_recorder), data_recorder),
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
m_editline_up(), m_editline_up(),
#endif #endif
m_delegate(delegate), m_prompt(), m_continuation_prompt(), m_delegate(delegate), m_prompt(), m_continuation_prompt(),
@ -244,7 +244,7 @@ IOHandlerEditline::IOHandlerEditline(
m_editing(false) { m_editing(false) {
SetPrompt(prompt); SetPrompt(prompt);
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
bool use_editline = false; bool use_editline = false;
use_editline = GetInputFILE() && GetOutputFILE() && GetErrorFILE() && use_editline = GetInputFILE() && GetOutputFILE() && GetErrorFILE() &&
@ -272,7 +272,7 @@ IOHandlerEditline::IOHandlerEditline(
} }
IOHandlerEditline::~IOHandlerEditline() { IOHandlerEditline::~IOHandlerEditline() {
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
m_editline_up.reset(); m_editline_up.reset();
#endif #endif
} }
@ -308,7 +308,7 @@ static Optional<std::string> SplitLineEOF(std::string &line_buffer) {
} }
bool IOHandlerEditline::GetLine(std::string &line, bool &interrupted) { bool IOHandlerEditline::GetLine(std::string &line, bool &interrupted) {
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
if (m_editline_up) { if (m_editline_up) {
bool b = m_editline_up->GetLine(line, interrupted); bool b = m_editline_up->GetLine(line, interrupted);
if (b && m_data_recorder) if (b && m_data_recorder)
@ -402,7 +402,7 @@ bool IOHandlerEditline::GetLine(std::string &line, bool &interrupted) {
return (bool)got_line; return (bool)got_line;
} }
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
bool IOHandlerEditline::IsInputCompleteCallback(Editline *editline, bool IOHandlerEditline::IsInputCompleteCallback(Editline *editline,
StringList &lines, StringList &lines,
void *baton) { void *baton) {
@ -429,14 +429,14 @@ void IOHandlerEditline::AutoCompleteCallback(CompletionRequest &request,
#endif #endif
const char *IOHandlerEditline::GetPrompt() { const char *IOHandlerEditline::GetPrompt() {
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
if (m_editline_up) { if (m_editline_up) {
return m_editline_up->GetPrompt(); return m_editline_up->GetPrompt();
} else { } else {
#endif #endif
if (m_prompt.empty()) if (m_prompt.empty())
return nullptr; return nullptr;
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
} }
#endif #endif
return m_prompt.c_str(); return m_prompt.c_str();
@ -445,7 +445,7 @@ const char *IOHandlerEditline::GetPrompt() {
bool IOHandlerEditline::SetPrompt(llvm::StringRef prompt) { bool IOHandlerEditline::SetPrompt(llvm::StringRef prompt) {
m_prompt = prompt; m_prompt = prompt;
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
if (m_editline_up) if (m_editline_up)
m_editline_up->SetPrompt(m_prompt.empty() ? nullptr : m_prompt.c_str()); m_editline_up->SetPrompt(m_prompt.empty() ? nullptr : m_prompt.c_str());
#endif #endif
@ -460,7 +460,7 @@ const char *IOHandlerEditline::GetContinuationPrompt() {
void IOHandlerEditline::SetContinuationPrompt(llvm::StringRef prompt) { void IOHandlerEditline::SetContinuationPrompt(llvm::StringRef prompt) {
m_continuation_prompt = prompt; m_continuation_prompt = prompt;
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
if (m_editline_up) if (m_editline_up)
m_editline_up->SetContinuationPrompt(m_continuation_prompt.empty() m_editline_up->SetContinuationPrompt(m_continuation_prompt.empty()
? nullptr ? nullptr
@ -473,7 +473,7 @@ void IOHandlerEditline::SetBaseLineNumber(uint32_t line) {
} }
uint32_t IOHandlerEditline::GetCurrentLineIndex() const { uint32_t IOHandlerEditline::GetCurrentLineIndex() const {
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
if (m_editline_up) if (m_editline_up)
return m_editline_up->GetCurrentLine(); return m_editline_up->GetCurrentLine();
#endif #endif
@ -484,7 +484,7 @@ bool IOHandlerEditline::GetLines(StringList &lines, bool &interrupted) {
m_current_lines_ptr = &lines; m_current_lines_ptr = &lines;
bool success = false; bool success = false;
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
if (m_editline_up) { if (m_editline_up) {
return m_editline_up->GetLines(m_base_line_number, lines, interrupted); return m_editline_up->GetLines(m_base_line_number, lines, interrupted);
} else { } else {
@ -514,7 +514,7 @@ bool IOHandlerEditline::GetLines(StringList &lines, bool &interrupted) {
} }
} }
success = lines.GetSize() > 0; success = lines.GetSize() > 0;
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
} }
#endif #endif
return success; return success;
@ -554,7 +554,7 @@ void IOHandlerEditline::Run() {
} }
void IOHandlerEditline::Cancel() { void IOHandlerEditline::Cancel() {
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
if (m_editline_up) if (m_editline_up)
m_editline_up->Cancel(); m_editline_up->Cancel();
#endif #endif
@ -565,7 +565,7 @@ bool IOHandlerEditline::Interrupt() {
if (m_delegate.IOHandlerInterrupt(*this)) if (m_delegate.IOHandlerInterrupt(*this))
return true; return true;
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
if (m_editline_up) if (m_editline_up)
return m_editline_up->Interrupt(); return m_editline_up->Interrupt();
#endif #endif
@ -573,14 +573,14 @@ bool IOHandlerEditline::Interrupt() {
} }
void IOHandlerEditline::GotEOF() { void IOHandlerEditline::GotEOF() {
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
if (m_editline_up) if (m_editline_up)
m_editline_up->Interrupt(); m_editline_up->Interrupt();
#endif #endif
} }
void IOHandlerEditline::PrintAsync(Stream *stream, const char *s, size_t len) { void IOHandlerEditline::PrintAsync(Stream *stream, const char *s, size_t len) {
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
if (m_editline_up) if (m_editline_up)
m_editline_up->PrintAsync(stream, s, len); m_editline_up->PrintAsync(stream, s, len);
else else

View File

@ -52,7 +52,7 @@ add_host_subdirectory(common
common/XML.cpp common/XML.cpp
) )
if (NOT LLDB_DISABLE_LIBEDIT) if (LLDB_ENABLE_LIBEDIT)
add_host_subdirectory(common add_host_subdirectory(common
common/Editline.cpp common/Editline.cpp
) )
@ -155,14 +155,14 @@ endif ()
if (HAVE_LIBDL) if (HAVE_LIBDL)
list(APPEND EXTRA_LIBS ${CMAKE_DL_LIBS}) list(APPEND EXTRA_LIBS ${CMAKE_DL_LIBS})
endif() endif()
if (NOT LLDB_DISABLE_LIBEDIT) if (LLDB_ENABLE_LIBEDIT)
list(APPEND EXTRA_LIBS ${libedit_LIBRARIES}) list(APPEND EXTRA_LIBS ${libedit_LIBRARIES})
endif() endif()
if (LLDB_ENABLE_LZMA) if (LLDB_ENABLE_LZMA)
list(APPEND EXTRA_LIBS ${LIBLZMA_LIBRARIES}) list(APPEND EXTRA_LIBS ${LIBLZMA_LIBRARIES})
endif() endif()
if (NOT LLDB_DISABLE_LIBEDIT) if (LLDB_ENABLE_LIBEDIT)
list(APPEND LLDB_LIBEDIT_LIBS ${libedit_LIBRARIES}) list(APPEND LLDB_LIBEDIT_LIBS ${libedit_LIBRARIES})
if (LLVM_BUILD_STATIC) if (LLVM_BUILD_STATIC)
list(APPEND LLDB_SYSTEM_LIBS gpm) list(APPEND LLDB_SYSTEM_LIBS gpm)
@ -183,6 +183,6 @@ add_lldb_library(lldbHost
Support Support
) )
if (NOT LLDB_DISABLE_LIBEDIT) if (LLDB_ENABLE_LIBEDIT)
target_include_directories(lldbHost PUBLIC ${libedit_INCLUDE_DIRS}) target_include_directories(lldbHost PUBLIC ${libedit_INCLUDE_DIRS})
endif() endif()

View File

@ -69,6 +69,6 @@ add_dependencies(lldbInterpreter
LLDBInterpreterPropertiesGen LLDBInterpreterPropertiesGen
LLDBInterpreterPropertiesEnumGen) LLDBInterpreterPropertiesEnumGen)
if (NOT LLDB_DISABLE_LIBEDIT) if (LLDB_ENABLE_LIBEDIT)
target_include_directories(lldbInterpreter PRIVATE ${libedit_INCLUDE_DIRS}) target_include_directories(lldbInterpreter PRIVATE ${libedit_INCLUDE_DIRS})
endif() endif()

View File

@ -49,7 +49,7 @@
#include "lldb/Utility/Timer.h" #include "lldb/Utility/Timer.h"
#include "lldb/Host/Config.h" #include "lldb/Host/Config.h"
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
#include "lldb/Host/Editline.h" #include "lldb/Host/Editline.h"
#endif #endif
#include "lldb/Host/Host.h" #include "lldb/Host/Host.h"

View File

@ -3,7 +3,7 @@ if(NOT LLDB_PYTHON_RELATIVE_PATH)
endif() endif()
add_definitions(-DLLDB_PYTHON_RELATIVE_LIBDIR="${LLDB_PYTHON_RELATIVE_PATH}") 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}) list(APPEND LLDB_LIBEDIT_LIBS ${libedit_LIBRARIES})
endif() endif()
@ -26,7 +26,7 @@ add_lldb_library(lldbPluginScriptInterpreterPython PLUGIN
Support Support
) )
if (NOT LLDB_DISABLE_LIBEDIT) if (LLDB_ENABLE_LIBEDIT)
target_include_directories(lldbPluginScriptInterpreterPython PUBLIC target_include_directories(lldbPluginScriptInterpreterPython PUBLIC
${libedit_INCLUDE_DIRS} ${libedit_INCLUDE_DIRS}
) )

View File

@ -9,7 +9,7 @@
#ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONREADLINE_H #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONREADLINE_H
#define 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 // 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 on some systems, you must include Python.h before any
// standard headers are included. // standard headers are included.

View File

@ -8,7 +8,7 @@
#include "lldb/Host/Config.h" #include "lldb/Host/Config.h"
#ifndef LLDB_DISABLE_LIBEDIT #if LLDB_ENABLE_LIBEDIT
#define EDITLINE_TEST_DUMP_OUTPUT 0 #define EDITLINE_TEST_DUMP_OUTPUT 0