[Lldb-commits] [lldb] r335260 - Partially revert r335236

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 21 10:36:32 PDT 2018


Author: labath
Date: Thu Jun 21 10:36:32 2018
New Revision: 335260

URL: http://llvm.org/viewvc/llvm-project?rev=335260&view=rev
Log:
Partially revert r335236

Jim pointed out that XCode has build configurations that build without
python and removing the ifdefs around the python code breaks them.

This reverts the #ifdef part of the above patch, while keeping the cmake
parts.

Modified:
    lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
    lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
    lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.cpp
    lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.h
    lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
    lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
    lldb/trunk/source/Plugins/ScriptInterpreter/Python/lldb-python.h

Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp?rev=335260&r1=335259&r2=335260&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp (original)
+++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp Thu Jun 21 10:36:32 2018
@@ -7,6 +7,12 @@
 //
 //===----------------------------------------------------------------------===//
 
+#ifdef LLDB_DISABLE_PYTHON
+
+// Python is disabled in this build
+
+#else
+
 #include "PythonDataObjects.h"
 #include "ScriptInterpreterPython.h"
 
@@ -1028,3 +1034,5 @@ bool PythonFile::GetUnderlyingFile(File
   file.SetOptions(PythonFile::GetOptionsFromMode(py_mode.GetString()));
   return file.IsValid();
 }
+
+#endif

Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h?rev=335260&r1=335259&r2=335260&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h (original)
+++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h Thu Jun 21 10:36:32 2018
@@ -10,6 +10,8 @@
 #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONDATAOBJECTS_H
 #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONDATAOBJECTS_H
 
+#ifndef LLDB_DISABLE_PYTHON
+
 // LLDB Python header must be included first
 #include "lldb-python.h"
 
@@ -468,3 +470,5 @@ public:
 } // namespace lldb_private
 
 #endif
+
+#endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONDATAOBJECTS_H

Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.cpp?rev=335260&r1=335259&r2=335260&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.cpp (original)
+++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.cpp Thu Jun 21 10:36:32 2018
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#ifndef LLDB_DISABLE_PYTHON
+
 // LLDB Python header must be included first
 #include "lldb-python.h"
 
@@ -164,3 +166,5 @@ std::string PythonExceptionState::ReadBa
 
   return retval;
 }
+
+#endif

Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.h?rev=335260&r1=335259&r2=335260&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.h (original)
+++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.h Thu Jun 21 10:36:32 2018
@@ -10,6 +10,8 @@
 #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONEXCEPTIONSTATE_H
 #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONEXCEPTIONSTATE_H
 
+#ifndef LLDB_DISABLE_PYTHON
+
 #include "PythonDataObjects.h"
 
 namespace lldb_private {
@@ -51,3 +53,5 @@ private:
 }
 
 #endif
+
+#endif

Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp?rev=335260&r1=335259&r2=335260&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp (original)
+++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp Thu Jun 21 10:36:32 2018
@@ -7,6 +7,12 @@
 //
 //===----------------------------------------------------------------------===//
 
+#ifdef LLDB_DISABLE_PYTHON
+
+// Python is disabled in this build
+
+#else
+
 // LLDB Python header must be included first
 #include "lldb-python.h"
 
@@ -3200,3 +3206,5 @@ void ScriptInterpreterPython::AddToSysPa
 // when the process exits).
 //
 // void ScriptInterpreterPython::Terminate() { Py_Finalize (); }
+
+#endif // LLDB_DISABLE_PYTHON

Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h?rev=335260&r1=335259&r2=335260&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h (original)
+++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h Thu Jun 21 10:36:32 2018
@@ -10,6 +10,12 @@
 #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H
 #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H
 
+#ifdef LLDB_DISABLE_PYTHON
+
+// Python is disabled in this build
+
+#else
+
 // C Includes
 // C++ Includes
 #include <memory>
@@ -565,4 +571,6 @@ protected:
 
 } // namespace lldb_private
 
+#endif // LLDB_DISABLE_PYTHON
+
 #endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H

Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/lldb-python.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/lldb-python.h?rev=335260&r1=335259&r2=335260&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ScriptInterpreter/Python/lldb-python.h (original)
+++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/lldb-python.h Thu Jun 21 10:36:32 2018
@@ -13,6 +13,9 @@
 // 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
 #include "llvm/Support/Compiler.h"
 #if defined(_WIN32)
 // If anyone #includes Host/PosixApi.h later, it will try to typedef pid_t.  We
@@ -32,5 +35,6 @@
 
 // Include python for non windows machines
 #include <Python.h>
+#endif // LLDB_DISABLE_PYTHON
 
 #endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_LLDB_PYTHON_H




More information about the lldb-commits mailing list