[lldb/Bindings] Move bindings into their own subdirectory
authorJonas Devlieghere <jonas@devlieghere.com>
Thu, 9 Jan 2020 15:57:59 +0000 (07:57 -0800)
committerJonas Devlieghere <jonas@devlieghere.com>
Thu, 9 Jan 2020 16:44:34 +0000 (08:44 -0800)
All the code required to generate the language bindings for Python and
Lua lives under scripts, even though the majority of this code aren't
scripts at all, and surrounded by scripts that are totally unrelated.

I've reorganized these files and moved everything related to the
language bindings into a new top-level directory named bindings. This
makes the corresponding files self contained and much more discoverable.

Differential revision: https://reviews.llvm.org/D72437

80 files changed:
lldb/CMakeLists.txt
lldb/bindings/CMakeLists.txt [moved from lldb/scripts/CMakeLists.txt with 93% similarity]
lldb/bindings/headers.swig [moved from lldb/scripts/headers.swig with 100% similarity]
lldb/bindings/interface/SBAddress.i [moved from lldb/scripts/interface/SBAddress.i with 100% similarity]
lldb/bindings/interface/SBAttachInfo.i [moved from lldb/scripts/interface/SBAttachInfo.i with 100% similarity]
lldb/bindings/interface/SBBlock.i [moved from lldb/scripts/interface/SBBlock.i with 100% similarity]
lldb/bindings/interface/SBBreakpoint.i [moved from lldb/scripts/interface/SBBreakpoint.i with 100% similarity]
lldb/bindings/interface/SBBreakpointLocation.i [moved from lldb/scripts/interface/SBBreakpointLocation.i with 100% similarity]
lldb/bindings/interface/SBBreakpointName.i [moved from lldb/scripts/interface/SBBreakpointName.i with 100% similarity]
lldb/bindings/interface/SBBroadcaster.i [moved from lldb/scripts/interface/SBBroadcaster.i with 100% similarity]
lldb/bindings/interface/SBCommandInterpreter.i [moved from lldb/scripts/interface/SBCommandInterpreter.i with 100% similarity]
lldb/bindings/interface/SBCommandReturnObject.i [moved from lldb/scripts/interface/SBCommandReturnObject.i with 100% similarity]
lldb/bindings/interface/SBCommunication.i [moved from lldb/scripts/interface/SBCommunication.i with 100% similarity]
lldb/bindings/interface/SBCompileUnit.i [moved from lldb/scripts/interface/SBCompileUnit.i with 100% similarity]
lldb/bindings/interface/SBData.i [moved from lldb/scripts/interface/SBData.i with 100% similarity]
lldb/bindings/interface/SBDebugger.i [moved from lldb/scripts/interface/SBDebugger.i with 100% similarity]
lldb/bindings/interface/SBDeclaration.i [moved from lldb/scripts/interface/SBDeclaration.i with 100% similarity]
lldb/bindings/interface/SBError.i [moved from lldb/scripts/interface/SBError.i with 100% similarity]
lldb/bindings/interface/SBEvent.i [moved from lldb/scripts/interface/SBEvent.i with 100% similarity]
lldb/bindings/interface/SBExecutionContext.i [moved from lldb/scripts/interface/SBExecutionContext.i with 100% similarity]
lldb/bindings/interface/SBExpressionOptions.i [moved from lldb/scripts/interface/SBExpressionOptions.i with 100% similarity]
lldb/bindings/interface/SBFile.i [moved from lldb/scripts/interface/SBFile.i with 100% similarity]
lldb/bindings/interface/SBFileSpec.i [moved from lldb/scripts/interface/SBFileSpec.i with 100% similarity]
lldb/bindings/interface/SBFileSpecList.i [moved from lldb/scripts/interface/SBFileSpecList.i with 100% similarity]
lldb/bindings/interface/SBFrame.i [moved from lldb/scripts/interface/SBFrame.i with 100% similarity]
lldb/bindings/interface/SBFunction.i [moved from lldb/scripts/interface/SBFunction.i with 100% similarity]
lldb/bindings/interface/SBHostOS.i [moved from lldb/scripts/interface/SBHostOS.i with 100% similarity]
lldb/bindings/interface/SBInstruction.i [moved from lldb/scripts/interface/SBInstruction.i with 100% similarity]
lldb/bindings/interface/SBInstructionList.i [moved from lldb/scripts/interface/SBInstructionList.i with 100% similarity]
lldb/bindings/interface/SBLanguageRuntime.i [moved from lldb/scripts/interface/SBLanguageRuntime.i with 100% similarity]
lldb/bindings/interface/SBLaunchInfo.i [moved from lldb/scripts/interface/SBLaunchInfo.i with 100% similarity]
lldb/bindings/interface/SBLineEntry.i [moved from lldb/scripts/interface/SBLineEntry.i with 100% similarity]
lldb/bindings/interface/SBListener.i [moved from lldb/scripts/interface/SBListener.i with 100% similarity]
lldb/bindings/interface/SBMemoryRegionInfo.i [moved from lldb/scripts/interface/SBMemoryRegionInfo.i with 100% similarity]
lldb/bindings/interface/SBMemoryRegionInfoList.i [moved from lldb/scripts/interface/SBMemoryRegionInfoList.i with 100% similarity]
lldb/bindings/interface/SBModule.i [moved from lldb/scripts/interface/SBModule.i with 100% similarity]
lldb/bindings/interface/SBModuleSpec.i [moved from lldb/scripts/interface/SBModuleSpec.i with 100% similarity]
lldb/bindings/interface/SBPlatform.i [moved from lldb/scripts/interface/SBPlatform.i with 100% similarity]
lldb/bindings/interface/SBProcess.i [moved from lldb/scripts/interface/SBProcess.i with 100% similarity]
lldb/bindings/interface/SBProcessInfo.i [moved from lldb/scripts/interface/SBProcessInfo.i with 100% similarity]
lldb/bindings/interface/SBQueue.i [moved from lldb/scripts/interface/SBQueue.i with 100% similarity]
lldb/bindings/interface/SBQueueItem.i [moved from lldb/scripts/interface/SBQueueItem.i with 100% similarity]
lldb/bindings/interface/SBSection.i [moved from lldb/scripts/interface/SBSection.i with 100% similarity]
lldb/bindings/interface/SBSourceManager.i [moved from lldb/scripts/interface/SBSourceManager.i with 100% similarity]
lldb/bindings/interface/SBStream.i [moved from lldb/scripts/interface/SBStream.i with 100% similarity]
lldb/bindings/interface/SBStringList.i [moved from lldb/scripts/interface/SBStringList.i with 100% similarity]
lldb/bindings/interface/SBStructuredData.i [moved from lldb/scripts/interface/SBStructuredData.i with 100% similarity]
lldb/bindings/interface/SBSymbol.i [moved from lldb/scripts/interface/SBSymbol.i with 100% similarity]
lldb/bindings/interface/SBSymbolContext.i [moved from lldb/scripts/interface/SBSymbolContext.i with 100% similarity]
lldb/bindings/interface/SBSymbolContextList.i [moved from lldb/scripts/interface/SBSymbolContextList.i with 100% similarity]
lldb/bindings/interface/SBTarget.i [moved from lldb/scripts/interface/SBTarget.i with 100% similarity]
lldb/bindings/interface/SBThread.i [moved from lldb/scripts/interface/SBThread.i with 100% similarity]
lldb/bindings/interface/SBThreadCollection.i [moved from lldb/scripts/interface/SBThreadCollection.i with 100% similarity]
lldb/bindings/interface/SBThreadPlan.i [moved from lldb/scripts/interface/SBThreadPlan.i with 100% similarity]
lldb/bindings/interface/SBTrace.i [moved from lldb/scripts/interface/SBTrace.i with 100% similarity]
lldb/bindings/interface/SBTraceOptions.i [moved from lldb/scripts/interface/SBTraceOptions.i with 100% similarity]
lldb/bindings/interface/SBType.i [moved from lldb/scripts/interface/SBType.i with 100% similarity]
lldb/bindings/interface/SBTypeCategory.i [moved from lldb/scripts/interface/SBTypeCategory.i with 100% similarity]
lldb/bindings/interface/SBTypeEnumMember.i [moved from lldb/scripts/interface/SBTypeEnumMember.i with 100% similarity]
lldb/bindings/interface/SBTypeFilter.i [moved from lldb/scripts/interface/SBTypeFilter.i with 100% similarity]
lldb/bindings/interface/SBTypeFormat.i [moved from lldb/scripts/interface/SBTypeFormat.i with 100% similarity]
lldb/bindings/interface/SBTypeNameSpecifier.i [moved from lldb/scripts/interface/SBTypeNameSpecifier.i with 100% similarity]
lldb/bindings/interface/SBTypeSummary.i [moved from lldb/scripts/interface/SBTypeSummary.i with 100% similarity]
lldb/bindings/interface/SBTypeSynthetic.i [moved from lldb/scripts/interface/SBTypeSynthetic.i with 100% similarity]
lldb/bindings/interface/SBUnixSignals.i [moved from lldb/scripts/interface/SBUnixSignals.i with 100% similarity]
lldb/bindings/interface/SBValue.i [moved from lldb/scripts/interface/SBValue.i with 100% similarity]
lldb/bindings/interface/SBValueList.i [moved from lldb/scripts/interface/SBValueList.i with 100% similarity]
lldb/bindings/interface/SBVariablesOptions.i [moved from lldb/scripts/interface/SBVariablesOptions.i with 100% similarity]
lldb/bindings/interface/SBWatchpoint.i [moved from lldb/scripts/interface/SBWatchpoint.i with 100% similarity]
lldb/bindings/interfaces.swig [moved from lldb/scripts/interfaces.swig with 99% similarity]
lldb/bindings/lua.swig [moved from lldb/scripts/lldb_lua.swig with 100% similarity]
lldb/bindings/macros.swig [moved from lldb/scripts/macros.swig with 100% similarity]
lldb/bindings/python.swig [moved from lldb/scripts/lldb.swig with 98% similarity]
lldb/bindings/python/createPythonInit.py [moved from lldb/scripts/Python/createPythonInit.py with 100% similarity]
lldb/bindings/python/python-extensions.swig [moved from lldb/scripts/Python/python-extensions.swig with 100% similarity]
lldb/bindings/python/python-swigsafecast.swig [moved from lldb/scripts/Python/python-swigsafecast.swig with 100% similarity]
lldb/bindings/python/python-typemaps.swig [moved from lldb/scripts/Python/python-typemaps.swig with 100% similarity]
lldb/bindings/python/python-wrapper.swig [moved from lldb/scripts/Python/python-wrapper.swig with 100% similarity]
lldb/docs/CMakeLists.txt
lldb/source/API/CMakeLists.txt

index 6170ab6..573b855 100644 (file)
@@ -56,7 +56,7 @@ if (LLDB_ENABLE_PYTHON)
 endif ()
 
 if (LLDB_ENABLE_PYTHON OR LLDB_ENABLE_LUA)
-  add_subdirectory(scripts)
+  add_subdirectory(bindings)
 endif ()
 
 # We need the headers generated by instrinsics_gen before we can compile
@@ -97,7 +97,7 @@ if(LLDB_INCLUDE_TESTS)
 endif()
 
 if (LLDB_ENABLE_PYTHON)
-  get_target_property(lldb_scripts_dir swig_wrapper BINARY_DIR)
+  get_target_property(lldb_bindings_dir swig_wrapper BINARY_DIR)
 
   if(LLDB_BUILD_FRAMEWORK)
     set(lldb_python_build_path "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Resources/Python/lldb")
@@ -109,7 +109,7 @@ if (LLDB_ENABLE_PYTHON)
   # to liblldb.so for the Python API(hardlink on Windows).
   add_custom_target(finish_swig ALL VERBATIM
     COMMAND ${CMAKE_COMMAND} -E make_directory ${lldb_python_build_path}
-    DEPENDS ${lldb_scripts_dir}/lldb.py
+    DEPENDS ${lldb_bindings_dir}/lldb.py
     COMMENT "Python script sym-linking LLDB Python API")
 
   if(NOT LLDB_USE_SYSTEM_SIX)
@@ -121,7 +121,7 @@ if (LLDB_ENABLE_PYTHON)
 
   add_custom_command(TARGET finish_swig POST_BUILD VERBATIM
     COMMAND ${CMAKE_COMMAND} -E copy
-      "${lldb_scripts_dir}/lldb.py"
+      "${lldb_bindings_dir}/lldb.py"
       "${lldb_python_build_path}/__init__.py")
 
   function(create_python_package pkg_dir)
@@ -131,7 +131,7 @@ if (LLDB_ENABLE_PYTHON)
     endif()
     if(NOT ARG_NOINIT)
       set(init_cmd COMMAND ${PYTHON_EXECUTABLE}
-          "${LLDB_SOURCE_DIR}/scripts/Python/createPythonInit.py"
+          "${LLDB_SOURCE_DIR}/bindings/python/createPythonInit.py"
           "${pkg_dir}" ${ARG_FILES})
     endif()
     add_custom_command(TARGET finish_swig POST_BUILD VERBATIM
similarity index 93%
rename from lldb/scripts/CMakeLists.txt
rename to lldb/bindings/CMakeLists.txt
index 515c632..92ae402 100644 (file)
@@ -1,4 +1,4 @@
-file(GLOB SWIG_INTERFACES interface/*.i)
+file(GLOB SWIG_INTERFACES interfaces/*.i)
 file(GLOB_RECURSE SWIG_SOURCES *.swig)
 file(GLOB SWIG_HEADERS
   ${LLDB_SOURCE_DIR}/include/lldb/API/*.h
@@ -46,7 +46,7 @@ if (LLDB_ENABLE_PYTHON)
         -python
         -threads
         -o ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp
-        ${LLDB_SOURCE_DIR}/scripts/lldb.swig
+        ${LLDB_SOURCE_DIR}/bindings/python.swig
     VERBATIM
     COMMENT "Builds LLDB Python wrapper")
 
@@ -67,7 +67,7 @@ if (LLDB_ENABLE_LUA)
         -lua
         -w503
         -o ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapLua.cpp
-        ${LLDB_SOURCE_DIR}/scripts/lldb_lua.swig
+        ${LLDB_SOURCE_DIR}/bindings/lua.swig
     VERBATIM
     COMMENT "Builds LLDB Lua wrapper")
 
similarity index 99%
rename from lldb/scripts/interfaces.swig
rename to lldb/bindings/interfaces.swig
index cc6bb91..780fe34 100644 (file)
@@ -32,8 +32,8 @@
 %include "./interface/SBEvent.i"
 %include "./interface/SBExecutionContext.i"
 %include "./interface/SBExpressionOptions.i"
-%include "./interface/SBFileSpec.i"
 %include "./interface/SBFile.i"
+%include "./interface/SBFileSpec.i"
 %include "./interface/SBFileSpecList.i"
 %include "./interface/SBFrame.i"
 %include "./interface/SBFunction.i"
@@ -75,9 +75,8 @@
 %include "./interface/SBTypeNameSpecifier.i"
 %include "./interface/SBTypeSummary.i"
 %include "./interface/SBTypeSynthetic.i"
+%include "./interface/SBUnixSignals.i"
 %include "./interface/SBValue.i"
 %include "./interface/SBValueList.i"
 %include "./interface/SBVariablesOptions.i"
 %include "./interface/SBWatchpoint.i"
-%include "./interface/SBUnixSignals.i"
-
similarity index 98%
rename from lldb/scripts/lldb.swig
rename to lldb/bindings/python.swig
index bebf9bf..cf716da 100644 (file)
@@ -117,7 +117,7 @@ def lldb_iter(obj, getsize, getelem):
 
 %{
 #include "../source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h"
-#include "../scripts/Python/python-swigsafecast.swig"
+#include "../bindings/python/python-swigsafecast.swig"
 using namespace lldb_private;
 using namespace lldb_private::python;
 using namespace lldb;
index 0082d00..8fa4686 100644 (file)
@@ -30,9 +30,9 @@ if (LLDB_ENABLE_PYTHON)
     # Because we don't build liblldb, epydoc will complain that the import of
     # _lldb.so failed, but that doesn't prevent it from generating the docs.
     file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lldb)
-    get_target_property(lldb_scripts_dir swig_wrapper BINARY_DIR)
+    get_target_property(lldb_bindings_dir swig_wrapper BINARY_DIR)
     add_custom_target(lldb-python-doc-package
-      COMMAND "${CMAKE_COMMAND}" -E copy "${lldb_scripts_dir}/lldb.py" "${CMAKE_CURRENT_BINARY_DIR}/lldb/__init__.py"
+      COMMAND "${CMAKE_COMMAND}" -E copy "${lldb_bindings_dir}/lldb.py" "${CMAKE_CURRENT_BINARY_DIR}/lldb/__init__.py"
       COMMENT "Copying lldb.py to pretend package.")
     add_dependencies(lldb-python-doc-package swig_wrapper)
 
index eea409b..e0ecf29 100644 (file)
@@ -5,13 +5,13 @@ endif()
 get_property(LLDB_ALL_PLUGINS GLOBAL PROPERTY LLDB_PLUGINS)
 
 if(LLDB_ENABLE_PYTHON)
-  get_target_property(lldb_scripts_dir swig_wrapper BINARY_DIR)
-  set(lldb_python_wrapper ${lldb_scripts_dir}/LLDBWrapPython.cpp)
+  get_target_property(lldb_bindings_dir swig_wrapper BINARY_DIR)
+  set(lldb_python_wrapper ${lldb_bindings_dir}/LLDBWrapPython.cpp)
 endif()
 
 if(LLDB_ENABLE_LUA)
-  get_target_property(lldb_scripts_dir swig_wrapper_lua BINARY_DIR)
-  set(lldb_lua_wrapper ${lldb_scripts_dir}/LLDBWrapLua.cpp)
+  get_target_property(lldb_bindings_dir swig_wrapper_lua BINARY_DIR)
+  set(lldb_lua_wrapper ${lldb_bindings_dir}/LLDBWrapLua.cpp)
 endif()
 
 if(LLDB_BUILD_FRAMEWORK)