From: Jonas Devlieghere Date: Fri, 13 Dec 2019 18:37:33 +0000 (-0800) Subject: [lldb/CMake] Rename LLDB_DISABLE_PYTHON to LLDB_ENABLE_PYTHON X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4e26cf2cfb2b140a33ec236153cb2f23b5c44127;p=platform%2Fupstream%2Fllvm.git [lldb/CMake] Rename LLDB_DISABLE_PYTHON to LLDB_ENABLE_PYTHON This matches the naming scheme used by LLVM and all the other optional dependencies in LLDB. Differential revision: https://reviews.llvm.org/D71482 --- diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt index e66fa49..3747c98 100644 --- a/lldb/CMakeLists.txt +++ b/lldb/CMakeLists.txt @@ -40,7 +40,7 @@ if (WIN32) add_definitions(-D_ENABLE_EXTENDED_ALIGNED_STORAGE) endif() -if (NOT LLDB_DISABLE_PYTHON) +if (LLDB_ENABLE_PYTHON) execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(True, False, ''))" @@ -91,7 +91,7 @@ if(LLDB_INCLUDE_TESTS) add_subdirectory(utils/lldb-dotest) endif() -if (NOT LLDB_DISABLE_PYTHON) +if (LLDB_ENABLE_PYTHON) get_target_property(lldb_scripts_dir swig_wrapper BINARY_DIR) if(LLDB_BUILD_FRAMEWORK) diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index d2ae1ba..da00603 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -24,16 +24,19 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darw set(LLDB_LINKER_SUPPORTS_GROUPS ON) endif() -set(default_disable_python OFF) +set(default_enable_python ON) set(default_enable_libedit ON) set(default_enable_curses ON) -# Temporary support the old LLDB_DISABLE_CURSES variable +# Temporary support the old LLDB_DISABLE_* variables if (DEFINED LLDB_DISABLE_CURSES) if (LLDB_DISABLE_CURSES) set(default_enable_curses OFF) - else() - set(default_enable_curses ON) + endif() +endif() +if (DEFINED LLDB_DISABLE_PYTHON) + if (LLDB_DISABLE_PYTHON) + set(default_enable_python OFF) endif() endif() @@ -45,14 +48,14 @@ if(CMAKE_SYSTEM_NAME MATCHES "Windows") set(default_enable_libedit OFF) set(default_enable_curses OFF) elseif(CMAKE_SYSTEM_NAME MATCHES "Android") - set(default_disable_python ON) + set(default_enable_python OFF) set(default_enable_libedit OFF) set(default_enable_curses OFF) elseif(IOS) - set(default_disable_python ON) + set(default_enable_python OFF) endif() -option(LLDB_DISABLE_PYTHON "Disable Python scripting integration." ${default_disable_python}) +option(LLDB_ENABLE_PYTHON "Enable Python scripting integration." ${default_enable_python}) option(LLDB_ENABLE_LIBEDIT "Enable the use of editline." ${default_enable_libedit}) option(LLDB_ENABLE_CURSES "Enable Curses integration." ${default_enable_curses}) option(LLDB_RELOCATABLE_PYTHON "Use the PYTHONHOME environment variable to locate Python." OFF) @@ -172,7 +175,7 @@ function(find_python_libs_windows_helper LOOKUP_DEBUG OUT_EXE_PATH_VARNAME OUT_L if (NOT PYTHON_EXE OR NOT PYTHON_LIB OR NOT PYTHON_DLL) message(WARNING "Unable to find all Python components. Python support will be disabled for this build.") - set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE) + set(LLDB_ENABLE_PYTHON 0 PARENT_SCOPE) return() endif() @@ -197,7 +200,7 @@ endfunction() function(find_python_libs_windows) if ("${PYTHON_HOME}" STREQUAL "") message(WARNING "LLDB embedded Python on Windows requires specifying a value for PYTHON_HOME. Python support disabled.") - set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE) + set(LLDB_ENABLE_PYTHON 0 PARENT_SCOPE) return() endif() @@ -214,7 +217,7 @@ function(find_python_libs_windows) else() message(WARNING "Unable to find ${PYTHON_INCLUDE_DIR}/patchlevel.h, Python installation is corrupt.") message(WARNING "Python support will be disabled for this build.") - set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE) + set(LLDB_ENABLE_PYTHON 0 PARENT_SCOPE) return() endif() @@ -226,8 +229,8 @@ function(find_python_libs_windows) # Lookup for both debug and release python installations find_python_libs_windows_helper(TRUE PYTHON_DEBUG_EXE PYTHON_DEBUG_LIB PYTHON_DEBUG_DLL PYTHON_DEBUG_VERSION_STRING) find_python_libs_windows_helper(FALSE PYTHON_RELEASE_EXE PYTHON_RELEASE_LIB PYTHON_RELEASE_DLL PYTHON_RELEASE_VERSION_STRING) - if(LLDB_DISABLE_PYTHON) - set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE) + if(NOT LLDB_ENABLE_PYTHON) + set(LLDB_ENABLE_PYTHON 0 PARENT_SCOPE) return() endif() @@ -250,8 +253,8 @@ function(find_python_libs_windows) set(LOOKUP_DEBUG_PYTHON FALSE) endif() find_python_libs_windows_helper(${LOOKUP_DEBUG_PYTHON} PYTHON_EXECUTABLE PYTHON_LIBRARY PYTHON_DLL PYTHON_VERSION_STRING) - if(LLDB_DISABLE_PYTHON) - set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE) + if(NOT LLDB_ENABLE_PYTHON) + set(LLDB_ENABLE_PYTHON 0 PARENT_SCOPE) return() endif() endif() @@ -286,12 +289,12 @@ endfunction(find_python_libs_windows) # Call find_python_libs_windows ahead of the rest of the python configuration. # It's possible that it won't find a python installation and will then set -# LLDB_DISABLE_PYTHON to ON. -if (NOT LLDB_DISABLE_PYTHON AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") +# LLDB_ENABLE_PYTHON to OFF. +if (LLDB_ENABLE_PYTHON AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") find_python_libs_windows() endif() -if (NOT LLDB_DISABLE_PYTHON) +if (LLDB_ENABLE_PYTHON) if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") if (NOT LLDB_RELOCATABLE_PYTHON) file(TO_CMAKE_PATH "${PYTHON_HOME}" LLDB_PYTHON_HOME) @@ -320,7 +323,7 @@ if (NOT LLDB_DISABLE_PYTHON) endif() endif() -if (LLDB_DISABLE_PYTHON) +if (NOT LLDB_ENABLE_PYTHON) unset(PYTHON_INCLUDE_DIR) unset(PYTHON_LIBRARY) unset(PYTHON_EXECUTABLE) diff --git a/lldb/docs/CMakeLists.txt b/lldb/docs/CMakeLists.txt index 1da6874..0082d00 100644 --- a/lldb/docs/CMakeLists.txt +++ b/lldb/docs/CMakeLists.txt @@ -15,7 +15,7 @@ if(DOXYGEN_FOUND) ) endif() -if (NOT LLDB_DISABLE_PYTHON) +if (LLDB_ENABLE_PYTHON) find_program(EPYDOC_EXECUTABLE NAMES epydoc epydoc.py) if(EPYDOC_EXECUTABLE) message(STATUS "Found epydoc - ${EPYDOC_EXECUTABLE}") diff --git a/lldb/docs/resources/build.rst b/lldb/docs/resources/build.rst index 4d9850c..499a79b 100644 --- a/lldb/docs/resources/build.rst +++ b/lldb/docs/resources/build.rst @@ -401,7 +401,7 @@ further by passing the appropriate cmake options, such as: :: - -DLLDB_DISABLE_PYTHON=1 + -DLLDB_ENABLE_PYTHON=0 -DLLDB_ENABLE_LIBEDIT=0 -DLLDB_ENABLE_CURSES=0 -DLLVM_ENABLE_TERMINFO=0 @@ -453,7 +453,7 @@ to prepare the cmake build with the following parameters: -DLLVM_HOST_TRIPLE=aarch64-unknown-linux-gnu \ -DLLVM_TABLEGEN=/bin/llvm-tblgen \ -DCLANG_TABLEGEN=/bin/clang-tblgen \ - -DLLDB_DISABLE_PYTHON=1 \ + -DLLDB_ENABLE_PYTHON=0 \ -DLLDB_ENABLE_LIBEDIT=0 \ -DLLDB_ENABLE_CURSES=0 @@ -471,7 +471,7 @@ options. In my case it was sufficient to add the following arguments to -I /usr/aarch64-linux-gnu/include If you wanted to build a full version of LLDB and avoid passing -``-DLLDB_DISABLE_PYTHON`` and other options, you would need to obtain the +``-DLLDB_ENABLE_PYTHON=0`` and other options, you would need to obtain the target versions of the respective libraries. The easiest way to achieve this is to use the qemu-debootstrap utility, which can prepare a system image using qemu and chroot to simulate the target environment. Then you can install the diff --git a/lldb/include/lldb/Host/Config.h.cmake b/lldb/include/lldb/Host/Config.h.cmake index fa95631..8012d79 100644 --- a/lldb/include/lldb/Host/Config.h.cmake +++ b/lldb/include/lldb/Host/Config.h.cmake @@ -42,7 +42,7 @@ #cmakedefine01 LLDB_ENABLE_LIBXML2 -#cmakedefine LLDB_DISABLE_PYTHON +#cmakedefine01 LLDB_ENABLE_PYTHON #cmakedefine LLDB_PYTHON_HOME "${LLDB_PYTHON_HOME}" diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py index 1e3df73..3d67b45 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest.py +++ b/lldb/packages/Python/lldbsuite/test/dotest.py @@ -617,7 +617,7 @@ def setupSysPath(): if not lldbPythonDir: print( "Unable to load lldb extension module. Possible reasons for this include:") - print(" 1) LLDB was built with LLDB_DISABLE_PYTHON=1") + print(" 1) LLDB was built with LLDB_ENABLE_PYTHON=0") print( " 2) PYTHONPATH and PYTHONHOME are not set correctly. PYTHONHOME should refer to") print( diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt index 934bbf2..1a99a26 100644 --- a/lldb/source/API/CMakeLists.txt +++ b/lldb/source/API/CMakeLists.txt @@ -4,7 +4,7 @@ endif() get_property(LLDB_ALL_PLUGINS GLOBAL PROPERTY LLDB_PLUGINS) -if(NOT LLDB_DISABLE_PYTHON) +if(LLDB_ENABLE_PYTHON) get_target_property(lldb_scripts_dir swig_wrapper BINARY_DIR) set(lldb_python_wrapper ${lldb_scripts_dir}/LLDBWrapPython.cpp) endif() @@ -154,7 +154,7 @@ endif() if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) # Only MSVC has the ABI compatibility problem and avoids using FindPythonLibs, # so only it needs to explicitly link against ${PYTHON_LIBRARY} - if (MSVC AND NOT LLDB_DISABLE_PYTHON) + if (MSVC AND LLDB_ENABLE_PYTHON) target_link_libraries(liblldb PRIVATE ${PYTHON_LIBRARY}) endif() else() diff --git a/lldb/source/API/SBHostOS.cpp b/lldb/source/API/SBHostOS.cpp index 2a1d17a..6ac8717 100644 --- a/lldb/source/API/SBHostOS.cpp +++ b/lldb/source/API/SBHostOS.cpp @@ -19,7 +19,7 @@ #include "lldb/Utility/FileSpec.h" #include "Plugins/ExpressionParser/Clang/ClangHost.h" -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON #include "Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h" #endif @@ -61,7 +61,7 @@ SBFileSpec SBHostOS::GetLLDBPath(lldb::PathType path_type) { fspec = HostInfo::GetHeaderDir(); break; case ePathTypePythonDir: -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON fspec = ScriptInterpreterPython::GetPythonDir(); #endif break; diff --git a/lldb/source/API/SystemInitializerFull.cpp b/lldb/source/API/SystemInitializerFull.cpp index ffb302d..35a02ec 100644 --- a/lldb/source/API/SystemInitializerFull.cpp +++ b/lldb/source/API/SystemInitializerFull.cpp @@ -10,7 +10,7 @@ #include "lldb/API/SBCommandInterpreter.h" #include "lldb/Host/Config.h" -#if !defined(LLDB_DISABLE_PYTHON) +#if LLDB_ENABLE_PYTHON #include "Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h" #endif @@ -179,11 +179,11 @@ llvm::Error SystemInitializerFull::Initialize() { ScriptInterpreterNone::Initialize(); -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON OperatingSystemPython::Initialize(); #endif -#if !defined(LLDB_DISABLE_PYTHON) +#if LLDB_ENABLE_PYTHON ScriptInterpreterPython::Initialize(); #endif @@ -375,7 +375,7 @@ void SystemInitializerFull::Terminate() { DynamicLoaderStatic::Terminate(); DynamicLoaderWindowsDYLD::Terminate(); -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON OperatingSystemPython::Terminate(); #endif diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index d743900..5669ce1 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -852,7 +852,7 @@ Process 1234 stopped bool CommandObjectFrameRecognizerAdd::DoExecute(Args &command, CommandReturnObject &result) { -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON if (m_options.m_class_name.empty()) { result.AppendErrorWithFormat( "%s needs a Python class name (-l argument).\n", m_cmd_name.c_str()); @@ -1106,7 +1106,7 @@ CommandObjectMultiwordFrame::CommandObjectMultiwordFrame( CommandObjectSP(new CommandObjectFrameSelect(interpreter))); LoadSubCommand("variable", CommandObjectSP(new CommandObjectFrameVariable(interpreter))); -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON LoadSubCommand("recognizer", CommandObjectSP(new CommandObjectFrameRecognizer( interpreter))); #endif diff --git a/lldb/source/Commands/CommandObjectType.cpp b/lldb/source/Commands/CommandObjectType.cpp index 265acb4..aca166e 100644 --- a/lldb/source/Commands/CommandObjectType.cpp +++ b/lldb/source/Commands/CommandObjectType.cpp @@ -163,7 +163,7 @@ public: std::string &data) override { StreamFileSP error_sp = io_handler.GetErrorStreamFileSP(); -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON ScriptInterpreter *interpreter = GetDebugger().GetScriptInterpreter(); if (interpreter) { StringList lines; @@ -256,7 +256,7 @@ public: "error: script interpreter missing, didn't add python command.\n"); error_sp->Flush(); } -#endif // LLDB_DISABLE_PYTHON +#endif io_handler.SetIsDone(true); } @@ -395,7 +395,7 @@ protected: std::string &data) override { StreamFileSP error_sp = io_handler.GetErrorStreamFileSP(); -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON ScriptInterpreter *interpreter = GetDebugger().GetScriptInterpreter(); if (interpreter) { StringList lines; @@ -475,7 +475,7 @@ protected: error_sp->Flush(); } -#endif // LLDB_DISABLE_PYTHON +#endif io_handler.SetIsDone(true); } @@ -1168,12 +1168,6 @@ public: "Show a list of current formats.") {} }; -#ifndef LLDB_DISABLE_PYTHON - -// CommandObjectTypeSummaryAdd - -#endif // LLDB_DISABLE_PYTHON - Status CommandObjectTypeSummaryAdd::CommandOptions::SetOptionValue( uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) { @@ -1256,7 +1250,7 @@ void CommandObjectTypeSummaryAdd::CommandOptions::OptionParsingStarting( m_category = "default"; } -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON bool CommandObjectTypeSummaryAdd::Execute_ScriptSummary( Args &command, CommandReturnObject &result) { @@ -1381,7 +1375,7 @@ bool CommandObjectTypeSummaryAdd::Execute_ScriptSummary( return result.Succeeded(); } -#endif // LLDB_DISABLE_PYTHON +#endif bool CommandObjectTypeSummaryAdd::Execute_StringSummary( Args &command, CommandReturnObject &result) { @@ -1579,13 +1573,13 @@ bool CommandObjectTypeSummaryAdd::DoExecute(Args &command, WarnOnPotentialUnquotedUnsignedType(command, result); if (m_options.m_is_add_script) { -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON return Execute_ScriptSummary(command, result); #else result.AppendError("python is disabled"); result.SetStatus(eReturnStatusFailed); return false; -#endif // LLDB_DISABLE_PYTHON +#endif } return Execute_StringSummary(command, result); @@ -2153,7 +2147,7 @@ public: "Show a list of current filters.") {} }; -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON // CommandObjectTypeSynthList @@ -2166,7 +2160,7 @@ public: "Show a list of current synthetic providers.") {} }; -#endif // LLDB_DISABLE_PYTHON +#endif // CommandObjectTypeFilterDelete @@ -2181,7 +2175,7 @@ public: ~CommandObjectTypeFilterDelete() override = default; }; -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON // CommandObjectTypeSynthDelete @@ -2197,7 +2191,7 @@ public: ~CommandObjectTypeSynthDelete() override = default; }; -#endif // LLDB_DISABLE_PYTHON +#endif // CommandObjectTypeFilterClear @@ -2210,7 +2204,7 @@ public: "type filter clear", "Delete all existing filter.") {} }; -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON // CommandObjectTypeSynthClear class CommandObjectTypeSynthClear : public CommandObjectTypeFormatterClear { @@ -2374,7 +2368,7 @@ bool CommandObjectTypeSynthAdd::AddSynth(ConstString type_name, } } -#endif // LLDB_DISABLE_PYTHON +#endif #define LLDB_OPTIONS_type_filter_add #include "CommandOptions.inc" @@ -2924,7 +2918,7 @@ public: ~CommandObjectTypeFormat() override = default; }; -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON class CommandObjectTypeSynth : public CommandObjectMultiword { public: @@ -2953,7 +2947,7 @@ public: ~CommandObjectTypeSynth() override = default; }; -#endif // LLDB_DISABLE_PYTHON +#endif class CommandObjectTypeFilter : public CommandObjectMultiword { public: @@ -3039,10 +3033,10 @@ CommandObjectType::CommandObjectType(CommandInterpreter &interpreter) CommandObjectSP(new CommandObjectTypeFormat(interpreter))); LoadSubCommand("summary", CommandObjectSP(new CommandObjectTypeSummary(interpreter))); -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON LoadSubCommand("synthetic", CommandObjectSP(new CommandObjectTypeSynth(interpreter))); -#endif // LLDB_DISABLE_PYTHON +#endif LoadSubCommand("lookup", CommandObjectSP(new CommandObjectTypeLookup(interpreter))); } diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index 596de20..1dd9a6c 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -303,7 +303,7 @@ bool ValueObject::UpdateFormatsIfNeeded() { SetValueFormat(DataVisualization::GetFormat(*this, eNoDynamicValues)); SetSummaryFormat( DataVisualization::GetSummaryFormat(*this, GetDynamicValueType())); -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON SetSyntheticChildren( DataVisualization::GetSyntheticChildren(*this, GetDynamicValueType())); #endif diff --git a/lldb/source/Interpreter/CommandObjectScript.cpp b/lldb/source/Interpreter/CommandObjectScript.cpp index d9ee30c..fe365a5 100644 --- a/lldb/source/Interpreter/CommandObjectScript.cpp +++ b/lldb/source/Interpreter/CommandObjectScript.cpp @@ -32,13 +32,7 @@ CommandObjectScript::~CommandObjectScript() {} bool CommandObjectScript::DoExecute(llvm::StringRef command, CommandReturnObject &result) { -#ifdef LLDB_DISABLE_PYTHON - // if we ever support languages other than Python this simple #ifdef won't - // work - result.AppendError("your copy of LLDB does not support scripting."); - result.SetStatus(eReturnStatusFailed); - return false; -#else +#if LLDB_ENABLE_PYTHON if (m_interpreter.GetDebugger().GetScriptLanguage() == lldb::eScriptLanguageNone) { result.AppendError( @@ -72,5 +66,11 @@ bool CommandObjectScript::DoExecute(llvm::StringRef command, result.SetStatus(eReturnStatusFailed); return result.Succeeded(); +#else + // if we ever support languages other than Python this simple #ifdef won't + // work + result.AppendError("your copy of LLDB does not support scripting."); + result.SetStatus(eReturnStatusFailed); + return false; #endif } diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp index 3ed48e1..106457c 100644 --- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp +++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp @@ -8,7 +8,7 @@ #include "lldb/Host/Config.h" -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON #include "OperatingSystemPython.h" @@ -418,4 +418,4 @@ lldb::ThreadSP OperatingSystemPython::CreateThread(lldb::tid_t tid, return ThreadSP(); } -#endif // #ifndef LLDB_DISABLE_PYTHON +#endif // #if LLDB_ENABLE_PYTHON diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h index e38f0f8..4a594cf2 100644 --- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h +++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h @@ -11,7 +11,7 @@ #include "lldb/Host/Config.h" -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON #include "lldb/Target/OperatingSystem.h" #include "lldb/Utility/StructuredData.h" @@ -82,6 +82,6 @@ protected: lldb_private::StructuredData::ObjectSP m_python_object_sp; }; -#endif // LLDB_DISABLE_PYTHON +#endif #endif // liblldb_OperatingSystemPython_h_ diff --git a/lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt b/lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt index 5d8642e..416f680 100644 --- a/lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt +++ b/lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt @@ -1,4 +1,4 @@ add_subdirectory(None) -if (NOT LLDB_DISABLE_PYTHON) +if (LLDB_ENABLE_PYTHON) add_subdirectory(Python) endif() diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp index 7880c3a..e5a6765 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp @@ -8,7 +8,7 @@ #include "lldb/Host/Config.h" -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON #include "PythonDataObjects.h" #include "ScriptInterpreterPython.h" diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h index ea33d44..b75045b 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h @@ -50,7 +50,7 @@ #include "lldb/Host/Config.h" -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON // LLDB Python header must be included first #include "lldb-python.h" diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 5c668bf..282c6e3 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -8,7 +8,7 @@ #include "lldb/Host/Config.h" -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON // LLDB Python header must be included first #include "lldb-python.h" @@ -3293,4 +3293,4 @@ void ScriptInterpreterPythonImpl::AddToSysPath(AddLocation location, // // void ScriptInterpreterPythonImpl::Terminate() { Py_Finalize (); } -#endif // LLDB_DISABLE_PYTHON +#endif diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h index 88f6975..e59fedb 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h @@ -11,11 +11,7 @@ #include "lldb/Host/Config.h" -#ifdef LLDB_DISABLE_PYTHON - -// Python is disabled in this build - -#else +#if LLDB_ENABLE_PYTHON #include "lldb/Breakpoint/BreakpointOptions.h" #include "lldb/Core/IOHandler.h" @@ -62,5 +58,5 @@ protected: }; } // namespace lldb_private -#endif // LLDB_DISABLE_PYTHON +#endif // LLDB_ENABLE_PYTHON #endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h index 281cfb1..81c6eb0 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h @@ -8,7 +8,7 @@ #include "lldb/Host/Config.h" -#ifndef LLDB_DISABLE_PYTHON +#if LLDB_ENABLE_PYTHON #include "lldb-python.h" diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h b/lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h index b2cd7a6..48f27b0 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h @@ -14,9 +14,7 @@ // Python.h needs to be included before any system headers in order to avoid // redefinition of macros -#ifdef LLDB_DISABLE_PYTHON -// Python is disabled in this build -#else +#if LLDB_ENABLE_PYTHON #include "llvm/Support/Compiler.h" #if defined(_WIN32) // If anyone #includes Host/PosixApi.h later, it will try to typedef pid_t. We @@ -42,6 +40,6 @@ // Include python for non windows machines #include -#endif // LLDB_DISABLE_PYTHON +#endif #endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_LLDB_PYTHON_H diff --git a/lldb/test/API/lit.site.cfg.py.in b/lldb/test/API/lit.site.cfg.py.in index b5e8ed9..374ca92 100644 --- a/lldb/test/API/lit.site.cfg.py.in +++ b/lldb/test/API/lit.site.cfg.py.in @@ -20,7 +20,7 @@ config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@" config.python_executable = "@PYTHON_EXECUTABLE@" config.dotest_path = "@LLDB_SOURCE_DIR@/test/API/dotest.py" config.dotest_args_str = "@LLDB_DOTEST_ARGS@" -config.lldb_disable_python = @LLDB_DISABLE_PYTHON@ +config.lldb_enable_python = @LLDB_ENABLE_PYTHON@ config.dotest_lit_args_str = None # The API tests use their own module caches. config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-api") diff --git a/lldb/test/API/lldbtest.py b/lldb/test/API/lldbtest.py index e7ba5eb..349a67f 100644 --- a/lldb/test/API/lldbtest.py +++ b/lldb/test/API/lldbtest.py @@ -55,7 +55,7 @@ class LLDBTest(TestFormat): if litConfig.noExecute: return lit.Test.PASS, '' - if test.config.lldb_disable_python: + if not test.config.lldb_enable_python: return (lit.Test.UNSUPPORTED, 'Python module disabled') if test.config.unsupported: diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt index e5704f6..d2fda3c 100644 --- a/lldb/test/CMakeLists.txt +++ b/lldb/test/CMakeLists.txt @@ -143,7 +143,7 @@ endif() # These values are not canonicalized within LLVM. llvm_canonicalize_cmake_booleans( - LLDB_DISABLE_PYTHON + LLDB_ENABLE_PYTHON LLVM_ENABLE_ZLIB LLVM_ENABLE_SHARED_LIBS LLDB_IS_64_BITS) diff --git a/lldb/test/Shell/lit.cfg.py b/lldb/test/Shell/lit.cfg.py index 68891e6..c0a6091 100644 --- a/lldb/test/Shell/lit.cfg.py +++ b/lldb/test/Shell/lit.cfg.py @@ -100,7 +100,7 @@ if 'native' in config.available_features: else: lit_config.warning("lit-cpuid failed: %s" % err) -if not config.lldb_disable_python: +if config.lldb_enable_python: config.available_features.add('python') if config.lldb_enable_lzma: diff --git a/lldb/test/Shell/lit.site.cfg.py.in b/lldb/test/Shell/lit.site.cfg.py.in index 39990a4..b391f8b 100644 --- a/lldb/test/Shell/lit.site.cfg.py.in +++ b/lldb/test/Shell/lit.site.cfg.py.in @@ -18,7 +18,7 @@ config.have_zlib = @LLVM_ENABLE_ZLIB@ config.lldb_enable_lzma = @LLDB_ENABLE_LZMA@ config.host_triple = "@LLVM_HOST_TRIPLE@" config.lldb_bitness = 64 if @LLDB_IS_64_BITS@ else 32 -config.lldb_disable_python = @LLDB_DISABLE_PYTHON@ +config.lldb_enable_python = @LLDB_ENABLE_PYTHON@ config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@" # The shell tests use their own module caches. config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-shell") diff --git a/lldb/tools/intel-features/CMakeLists.txt b/lldb/tools/intel-features/CMakeLists.txt index b531654..aff75d7 100644 --- a/lldb/tools/intel-features/CMakeLists.txt +++ b/lldb/tools/intel-features/CMakeLists.txt @@ -23,7 +23,7 @@ if (LLDB_BUILD_INTEL_PT) endif() # Add python wrapper if python not disabled -if (NOT LLDB_DISABLE_PYTHON AND LLDB_BUILD_INTEL_PT) +if (LLDB_ENABLE_PYTHON AND LLDB_BUILD_INTEL_PT) set(LLDB_INTEL_FEATURES_PYTHON_WRAP ${LLDB_BINARY_DIR}/tools/intel-features/scripts/IntelFeaturesPythonWrap.cpp) set_source_files_properties(${LLDB_INTEL_FEATURES_PYTHON_WRAP} @@ -59,7 +59,7 @@ add_lldb_library(lldbIntelFeatures SHARED ) # Add link dependencies for python wrapper -if (NOT LLDB_DISABLE_PYTHON AND LLDB_BUILD_INTEL_PT) +if (LLDB_ENABLE_PYTHON AND LLDB_BUILD_INTEL_PT) add_dependencies(lldbIntelFeatures intel-features-swig_wrapper) endif() diff --git a/lldb/unittests/ScriptInterpreter/CMakeLists.txt b/lldb/unittests/ScriptInterpreter/CMakeLists.txt index 667e7a7..06d909b 100644 --- a/lldb/unittests/ScriptInterpreter/CMakeLists.txt +++ b/lldb/unittests/ScriptInterpreter/CMakeLists.txt @@ -1,3 +1,3 @@ -if (NOT LLDB_DISABLE_PYTHON) +if (LLDB_ENABLE_PYTHON) add_subdirectory(Python) endif()