diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/CMakeLists.txt b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/CMakeLists.txt index eb22a960b5345..6ba714ed1c263 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/CMakeLists.txt +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/CMakeLists.txt @@ -19,8 +19,13 @@ if (LLDB_ENABLE_LIBEDIT) list(APPEND LLDB_LIBEDIT_LIBS LibEdit::LibEdit) endif() -add_lldb_library(lldbPluginScriptInterpreterPythonInterfaces +add_lldb_library(lldbPluginScriptInterpreterPythonInterfaces PLUGIN + OperatingSystemPythonInterface.cpp + ScriptInterpreterPythonInterfaces.cpp + ScriptedPlatformPythonInterface.cpp + ScriptedProcessPythonInterface.cpp ScriptedPythonInterface.cpp + ScriptedThreadPlanPythonInterface.cpp ScriptedThreadPythonInterface.cpp LINK_LIBS @@ -35,8 +40,4 @@ add_lldb_library(lldbPluginScriptInterpreterPythonInterfaces Support ) -add_subdirectory(OperatingSystemPythonInterface) -add_subdirectory(ScriptedPlatformPythonInterface) -add_subdirectory(ScriptedProcessPythonInterface) -add_subdirectory(ScriptedThreadPlanPythonInterface) diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface/OperatingSystemPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp similarity index 93% rename from lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface/OperatingSystemPythonInterface.cpp rename to lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp index 019db269a905b..c3379e774a0b8 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface/OperatingSystemPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp @@ -16,11 +16,11 @@ // clang-format off // LLDB Python header must be included first -#include "../../lldb-python.h" +#include "../lldb-python.h" //clang-format on -#include "../../SWIGPythonBridge.h" -#include "../../ScriptInterpreterPythonImpl.h" +#include "../SWIGPythonBridge.h" +#include "../ScriptInterpreterPythonImpl.h" #include "OperatingSystemPythonInterface.h" using namespace lldb; @@ -28,8 +28,6 @@ using namespace lldb_private; using namespace lldb_private::python; using Locker = ScriptInterpreterPythonImpl::Locker; -LLDB_PLUGIN_DEFINE_ADV(OperatingSystemPythonInterface, ScriptInterpreterPythonOperatingSystemPythonInterface) - OperatingSystemPythonInterface::OperatingSystemPythonInterface( ScriptInterpreterPythonImpl &interpreter) : OperatingSystemInterface(), ScriptedThreadPythonInterface(interpreter) {} diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface/OperatingSystemPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.h similarity index 97% rename from lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface/OperatingSystemPythonInterface.h rename to lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.h index 6d60f8b437d1c..92358ac6c34f7 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface/OperatingSystemPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.h @@ -14,7 +14,7 @@ #if LLDB_ENABLE_PYTHON -#include "../ScriptedThreadPythonInterface.h" +#include "ScriptedThreadPythonInterface.h" #include diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface/CMakeLists.txt b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface/CMakeLists.txt deleted file mode 100644 index b48f1e818e5d5..0000000000000 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -add_lldb_library(lldbPluginScriptInterpreterPythonOperatingSystemPythonInterface PLUGIN - - OperatingSystemPythonInterface.cpp - - LINK_LIBS - lldbCore - lldbHost - lldbInterpreter - lldbTarget - lldbPluginScriptInterpreterPython - ${Python3_LIBRARIES} - ${LLDB_LIBEDIT_LIBS} - - LINK_COMPONENTS - Support - ) diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.cpp new file mode 100644 index 0000000000000..38b644366080e --- /dev/null +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.cpp @@ -0,0 +1,41 @@ +//===-- ScriptInterpreterPythonInterfaces.cpp -----------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "lldb/Core/PluginManager.h" +#include "lldb/Host/Config.h" +#include "lldb/lldb-enumerations.h" + +#if LLDB_ENABLE_PYTHON + +#include "ScriptInterpreterPythonInterfaces.h" + +using namespace lldb; +using namespace lldb_private; + +LLDB_PLUGIN_DEFINE(ScriptInterpreterPythonInterfaces) + +llvm::StringRef +ScriptInterpreterPythonInterfaces::GetPluginDescriptionStatic() { + return "Script Interpreter Python Interfaces"; +} + +void ScriptInterpreterPythonInterfaces::Initialize() { + OperatingSystemPythonInterface::Initialize(); + ScriptedPlatformPythonInterface::Initialize(); + ScriptedProcessPythonInterface::Initialize(); + ScriptedThreadPlanPythonInterface::Initialize(); +} + +void ScriptInterpreterPythonInterfaces::Terminate() { + OperatingSystemPythonInterface::Terminate(); + ScriptedPlatformPythonInterface::Terminate(); + ScriptedProcessPythonInterface::Terminate(); + ScriptedThreadPlanPythonInterface::Terminate(); +} + +#endif diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.h new file mode 100644 index 0000000000000..36b521480cc85 --- /dev/null +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptInterpreterPythonInterfaces.h @@ -0,0 +1,36 @@ +//===-- ScriptInterpreterPythonInterfaces.h ---------------------*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHONINTERFACES_H +#define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHONINTERFACES_H + +#include "lldb/Core/PluginInterface.h" +#include "lldb/Host/Config.h" +#include "lldb/lldb-private.h" + +#if LLDB_ENABLE_PYTHON + +#include "OperatingSystemPythonInterface.h" +#include "ScriptedPlatformPythonInterface.h" +#include "ScriptedProcessPythonInterface.h" +#include "ScriptedThreadPlanPythonInterface.h" + +namespace lldb_private { +class ScriptInterpreterPythonInterfaces : public PluginInterface { +public: + static void Initialize(); + static void Terminate(); + static llvm::StringRef GetPluginNameStatic() { + return "script-interpreter-python-interfaces"; + } + static llvm::StringRef GetPluginDescriptionStatic(); +}; +} // namespace lldb_private + +#endif // LLDB_ENABLE_PYTHON +#endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHONINTERFACES_H diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface/ScriptedPlatformPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.cpp similarity index 94% rename from lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface/ScriptedPlatformPythonInterface.cpp rename to lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.cpp index 3586251bd4aac..0c078f019b8f3 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface/ScriptedPlatformPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.cpp @@ -17,11 +17,11 @@ // clang-format off // LLDB Python header must be included first -#include "../../lldb-python.h" +#include "../lldb-python.h" //clang-format on -#include "../../SWIGPythonBridge.h" -#include "../../ScriptInterpreterPythonImpl.h" +#include "../SWIGPythonBridge.h" +#include "../ScriptInterpreterPythonImpl.h" #include "ScriptedPlatformPythonInterface.h" using namespace lldb; @@ -29,8 +29,6 @@ using namespace lldb_private; using namespace lldb_private::python; using Locker = ScriptInterpreterPythonImpl::Locker; -LLDB_PLUGIN_DEFINE_ADV(ScriptedPlatformPythonInterface, ScriptInterpreterPythonScriptedPlatformPythonInterface) - ScriptedPlatformPythonInterface::ScriptedPlatformPythonInterface( ScriptInterpreterPythonImpl &interpreter) : ScriptedPlatformInterface(), ScriptedPythonInterface(interpreter) {} diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface/ScriptedPlatformPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.h similarity index 98% rename from lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface/ScriptedPlatformPythonInterface.h rename to lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.h index 01ee40a5a197c..36a219a656993 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface/ScriptedPlatformPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.h @@ -14,7 +14,7 @@ #if LLDB_ENABLE_PYTHON -#include "../ScriptedPythonInterface.h" +#include "ScriptedPythonInterface.h" namespace lldb_private { class ScriptedPlatformPythonInterface : public ScriptedPlatformInterface, diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface/CMakeLists.txt b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface/CMakeLists.txt deleted file mode 100644 index ae5e525229c02..0000000000000 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -add_lldb_library(lldbPluginScriptInterpreterPythonScriptedPlatformPythonInterface PLUGIN - - ScriptedPlatformPythonInterface.cpp - - LINK_LIBS - lldbCore - lldbHost - lldbInterpreter - lldbTarget - lldbPluginScriptInterpreterPython - ${Python3_LIBRARIES} - ${LLDB_LIBEDIT_LIBS} - - LINK_COMPONENTS - Support - ) diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface/ScriptedProcessPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.cpp similarity index 96% rename from lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface/ScriptedProcessPythonInterface.cpp rename to lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.cpp index c744d7028d04e..8ba31b31e8dc1 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface/ScriptedProcessPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.cpp @@ -16,11 +16,11 @@ // clang-format off // LLDB Python header must be included first -#include "../../lldb-python.h" +#include "../lldb-python.h" -#include "../../SWIGPythonBridge.h" -#include "../../ScriptInterpreterPythonImpl.h" -#include "../ScriptedThreadPythonInterface.h" +#include "../SWIGPythonBridge.h" +#include "../ScriptInterpreterPythonImpl.h" +#include "ScriptedThreadPythonInterface.h" #include "ScriptedProcessPythonInterface.h" // Included in this position to prevent redefinition of pid_t on Windows. @@ -34,8 +34,6 @@ using namespace lldb_private; using namespace lldb_private::python; using Locker = ScriptInterpreterPythonImpl::Locker; -LLDB_PLUGIN_DEFINE_ADV(ScriptedProcessPythonInterface, ScriptInterpreterPythonScriptedProcessPythonInterface) - ScriptedProcessPythonInterface::ScriptedProcessPythonInterface( ScriptInterpreterPythonImpl &interpreter) : ScriptedProcessInterface(), ScriptedPythonInterface(interpreter) {} diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface/ScriptedProcessPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.h similarity index 98% rename from lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface/ScriptedProcessPythonInterface.h rename to lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.h index bb27734739f43..1535d573e72f4 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface/ScriptedProcessPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.h @@ -14,7 +14,7 @@ #if LLDB_ENABLE_PYTHON -#include "../ScriptedPythonInterface.h" +#include "ScriptedPythonInterface.h" #include diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface/CMakeLists.txt b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface/CMakeLists.txt deleted file mode 100644 index 66ed041853f67..0000000000000 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -add_lldb_library(lldbPluginScriptInterpreterPythonScriptedProcessPythonInterface PLUGIN - - ScriptedProcessPythonInterface.cpp - - LINK_LIBS - lldbCore - lldbHost - lldbInterpreter - lldbTarget - lldbPluginScriptInterpreterPython - ${Python3_LIBRARIES} - ${LLDB_LIBEDIT_LIBS} - - LINK_COMPONENTS - Support - ) diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface/ScriptedThreadPlanPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.cpp similarity index 94% rename from lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface/ScriptedThreadPlanPythonInterface.cpp rename to lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.cpp index 5f1c7da71bd52..14c48a4e4a117 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface/ScriptedThreadPlanPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.cpp @@ -15,19 +15,17 @@ // clang-format off // LLDB Python header must be included first -#include "../../lldb-python.h" +#include "../lldb-python.h" //clang-format on -#include "../../SWIGPythonBridge.h" -#include "../../ScriptInterpreterPythonImpl.h" +#include "../SWIGPythonBridge.h" +#include "../ScriptInterpreterPythonImpl.h" #include "ScriptedThreadPlanPythonInterface.h" using namespace lldb; using namespace lldb_private; using namespace lldb_private::python; -LLDB_PLUGIN_DEFINE_ADV(ScriptedThreadPlanPythonInterface, ScriptInterpreterPythonScriptedThreadPlanPythonInterface) - ScriptedThreadPlanPythonInterface::ScriptedThreadPlanPythonInterface( ScriptInterpreterPythonImpl &interpreter) : ScriptedThreadPlanInterface(), ScriptedPythonInterface(interpreter) {} diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface/ScriptedThreadPlanPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.h similarity index 98% rename from lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface/ScriptedThreadPlanPythonInterface.h rename to lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.h index c0a82f4cbf46a..5e78ae764eeb5 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface/ScriptedThreadPlanPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.h @@ -14,7 +14,7 @@ #if LLDB_ENABLE_PYTHON -#include "../ScriptedPythonInterface.h" +#include "ScriptedPythonInterface.h" #include diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface/CMakeLists.txt b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface/CMakeLists.txt deleted file mode 100644 index db41da165d275..0000000000000 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -add_lldb_library(lldbPluginScriptInterpreterPythonScriptedThreadPlanPythonInterface PLUGIN - - ScriptedThreadPlanPythonInterface.cpp - - LINK_LIBS - lldbCore - lldbHost - lldbInterpreter - lldbTarget - lldbPluginScriptInterpreterPython - ${Python3_LIBRARIES} - ${LLDB_LIBEDIT_LIBS} - - LINK_COMPONENTS - Support - ) diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index a78c76b5f94ff..335c482f8495a 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -14,10 +14,7 @@ // LLDB Python header must be included first #include "lldb-python.h" -#include "Interfaces/OperatingSystemPythonInterface/OperatingSystemPythonInterface.h" -#include "Interfaces/ScriptedPlatformPythonInterface/ScriptedPlatformPythonInterface.h" -#include "Interfaces/ScriptedProcessPythonInterface/ScriptedProcessPythonInterface.h" -#include "Interfaces/ScriptedThreadPlanPythonInterface/ScriptedThreadPlanPythonInterface.h" +#include "Interfaces/ScriptInterpreterPythonInterfaces.h" #include "PythonDataObjects.h" #include "PythonReadline.h" #include "SWIGPythonBridge.h"